Documentation
¶
Overview ¶
Package result defines the machine-readable benchmark result schema (issue #141 §9) that every benchmark run writes, and the JSON/CSV encoders the summarizer and report generator read back. Markdown is never the canonical data source — it is generated from this.
Index ¶
Constants ¶
const SchemaVersion = 1
SchemaVersion is bumped when the Result shape changes incompatibly, so a stored results.json can be recognized (or rejected) by a later summarizer.
Variables ¶
This section is empty.
Functions ¶
func WriteCSV ¶
WriteCSV writes results as CSV with a fixed header, sorted deterministically (framework, benchmark, concurrency, trial) so a regenerated file diffs cleanly regardless of the order rows were collected in.
func WriteJSON ¶
WriteJSON encodes results as a pretty-printed JSON array. This is the canonical machine-readable output; results.csv and the Markdown report are derived from it. Rows are sorted the same way WriteCSV sorts them, so the committed results.json is stable across runs that collected rows in a different order.
Types ¶
type Result ¶
type Result struct {
SchemaVersion int `json:"schema_version"`
Framework string `json:"framework"`
FrameworkVersion string `json:"framework_version"`
Runtime string `json:"runtime"`
RuntimeVersion string `json:"runtime_version"`
Benchmark string `json:"benchmark"`
Database string `json:"database"`
Concurrency int `json:"concurrency"`
Trial int `json:"trial"`
DurationSeconds float64 `json:"duration_seconds"`
Requests int64 `json:"requests"`
RequestsPerSecond float64 `json:"requests_per_second"`
LatencyMs Latency `json:"latency_ms"`
Errors int64 `json:"errors"`
CPUPercent float64 `json:"cpu_percent"`
RSSBytes int64 `json:"rss_bytes"`
}
Result is one row: one implementation, one workload, one concurrency level, one trial. Issue #141 §9's recommended schema, plus schema_version. One trial per Result — variance across trials is computed by the summarizer from the set of rows sharing a (Framework, Benchmark, Concurrency) key, not stored here.