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 ProvenanceUnit ¶ added in v0.2.1
ProvenanceUnit is the key a CRUD row's provenance is filed under in metadata.json: the same (framework, benchmark) pair scripts/run-crud merges rows on, in a form readable in JSON.
It must stay the merge key. Keying provenance on the framework alone would let a run of one workload relabel another workload's rows it never touched — the row-merge-vs-table-provenance mismatch issue #266 exists to eliminate (#361). Both the writer (scripts/run-crud) and the reader (internal/report) derive the unit here so they cannot drift apart. It takes the pair rather than a Result because the reader holds summary groups, not rows.
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.
func (Result) ProvenanceUnit ¶ added in v0.2.1
ProvenanceUnit is this row's provenance unit; see the package-level ProvenanceUnit.