Documentation
¶
Overview ¶
Package compare calculates explicit, dimension-preserving comparisons of saved runs.
Index ¶
Constants ¶
View Source
const ( Schema = 1 MaxRuns = 8 MinRuns = 2 )
Variables ¶
View Source
var (
ErrSelection = errors.New("comparison requires 2–8 distinct history IDs and a selected reference")
)
Functions ¶
Types ¶
type Cell ¶
type Cell struct {
Value *json.Number `json:"value"`
Reason string `json:"reason,omitempty"`
Delta *json.Number `json:"delta"`
Percent *json.Number `json:"percent"`
PercentReason string `json:"percent_reason,omitempty"`
Rounded bool `json:"rounded,omitempty"`
DeltaReason string `json:"delta_reason,omitempty"`
}
Cell distinguishes absent/incompatible data from a recorded zero.
type Difference ¶
Difference retains missing values separately from explicit nulls.
type Input ¶
type Input struct {
ID string
Data json.RawMessage
}
Input retains the history identity separately from reusable run IDs.
type Result ¶
type Result struct {
Schema int `json:"schema"`
Kind string `json:"kind"`
Reference string `json:"reference"`
Runs []Run `json:"runs"`
Differences []Difference `json:"differences"`
Metrics []Row `json:"metrics"`
Warnings []string `json:"warnings"`
}
Result is shared by machine, terminal, and HTML presentations.
type Row ¶
type Row struct {
Name string `json:"name"`
Type string `json:"type"`
Unit string `json:"unit"`
Scope string `json:"scope"`
Attributes map[string]any `json:"attributes,omitempty"`
Statistic string `json:"statistic"`
ValueUnit string `json:"value_unit"`
Approximate bool `json:"approximate,omitempty"`
Bounds []json.Number `json:"bounds,omitempty"`
Cells []Cell `json:"cells"`
}
Row is one statistic with an exact recorded type, unit, and dimension scope.
type Run ¶
type Run struct {
ID string `json:"history_id"`
Workload string `json:"workload"`
Status string `json:"status"`
Source json.RawMessage `json:"source"`
Warnings []string `json:"warnings"`
// contains filtered or unexported fields
}
Run preserves source JSON, including unknown fields and exact source numbers.
Click to show internal directories.
Click to hide internal directories.