report

package
v1.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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.

func SaveRun

func SaveRun(r *runner.SuiteResult) (string, error)

SaveRun persists r under ~/.docsgpt/bench/<suite>/ as a timestamped file and (over)writes latest.json. It returns the timestamped file path.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL