Documentation
¶
Overview ¶
Package report renders a runner.SuiteResult in several forms — a colored terminal summary, machine-readable JSON, JUnit XML for CI, an A/B comparison table, and a diff against a saved baseline — plus the run-history store under ~/.docsgpt/bench.
Index ¶
- func Compare(w io.Writer, results []*runner.SuiteResult)
- func Diff(w io.Writer, base, cur *runner.SuiteResult) (regressions int)
- func JSON(w io.Writer, r *runner.SuiteResult) error
- func JUnit(w io.Writer, r *runner.SuiteResult) error
- func LoadBaseline(suiteName, ref string) (*runner.SuiteResult, error)
- func Matrix(w io.Writer, m *MatrixResult)
- func MatrixJSON(w io.Writer, m *MatrixResult) error
- func Pretty(w io.Writer, r *runner.SuiteResult, verbose bool)
- func SaveRun(r *runner.SuiteResult) (string, error)
- type MatrixResult
- type MatrixSummary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compare ¶
func Compare(w io.Writer, results []*runner.SuiteResult)
Compare writes an A/B (or A/B/C…) table: one row per case, one column per run, each cell showing that run's case status, latency, and total tokens. Cases absent from a run render as "-". A footer summarizes pass counts.
func Diff ¶
func Diff(w io.Writer, base, cur *runner.SuiteResult) (regressions int)
Diff writes a human-readable comparison of cur against base and returns the number of regressions (a case that passed in base and now fails or errors).
func JSON ¶
func JSON(w io.Writer, r *runner.SuiteResult) error
JSON writes the indented SuiteResult document (schema_version 1) to w.
func JUnit ¶
func JUnit(w io.Writer, r *runner.SuiteResult) error
JUnit writes a single <testsuite> with one <testcase> per case. Failing cases carry a <failure> (assertion messages), errored cases an <error>, skipped cases a <skipped>. All content is escaped by encoding/xml.
func LoadBaseline ¶
func LoadBaseline(suiteName, ref string) (*runner.SuiteResult, error)
LoadBaseline loads a saved run. ref "last" (or "") reads the suite's latest.json; any other ref is treated as a file path, with a fallback lookup inside the suite's history directory for convenience.
func Matrix ¶
func Matrix(w io.Writer, m *MatrixResult)
Matrix writes the per-model comparison table: pass rate, mean judge score, p50/p95 wall, TTFT, tokens/case, cost/case. Columns whose data no model reported are omitted.
func MatrixJSON ¶
func MatrixJSON(w io.Writer, m *MatrixResult) error
MatrixJSON writes the matrix document.
func Pretty ¶
func Pretty(w io.Writer, r *runner.SuiteResult, verbose bool)
Pretty writes a colored, aligned terminal report. verbose additionally prints each run's answer and judge reasoning. It relies on the active display theme (display.InitTheme / UsePlainTheme), degrading to plain text when color is unavailable.
Types ¶
type MatrixResult ¶
type MatrixResult struct {
SchemaVersion int `json:"schema_version"`
Kind string `json:"kind"` // "matrix"
Suite string `json:"suite"`
Dir string `json:"dir"`
StartedAt time.Time `json:"started_at"`
DurationMS int64 `json:"duration_ms"`
Models []string `json:"models"`
Summary []MatrixSummary `json:"summary"`
Results map[string]map[string]*runner.CaseResult `json:"results"`
Runs []*runner.SuiteResult `json:"runs"`
}
MatrixResult is the JSON document of a `bench --matrix` run: one full SuiteResult per model plus the derived comparison rows. Results are keyed results[model][case] for direct lookup.
func NewMatrix ¶
func NewMatrix(models []string, runs []*runner.SuiteResult) *MatrixResult
NewMatrix folds per-model suite results (in matrix order) into a MatrixResult.
type MatrixSummary ¶
type MatrixSummary struct {
Model string `json:"model"`
Cases int `json:"cases"`
Pass int `json:"pass"`
Fail int `json:"fail"`
Error int `json:"error"`
Skip int `json:"skip"`
PassRate float64 `json:"pass_rate"` // pass / (cases - skip), 0..1
JudgeMean *float64 `json:"judge_mean,omitempty"`
JudgeN int `json:"judge_n,omitempty"`
P50MS float64 `json:"p50_ms"`
P95MS float64 `json:"p95_ms"`
TTFTP50MS *float64 `json:"ttft_p50_ms,omitempty"`
TTFTP95MS *float64 `json:"ttft_p95_ms,omitempty"`
TokensPerCase *float64 `json:"tokens_per_case,omitempty"`
CostPerCase *float64 `json:"cost_per_case_usd,omitempty"`
TotalCost *float64 `json:"total_cost_usd,omitempty"`
DurationMS int64 `json:"duration_ms"`
}
MatrixSummary is one model's row of the comparison table.