Documentation
¶
Overview ¶
Package report renders a finished run as a single self-contained HTML file.
The file has no scripts, no external stylesheet, no web font and no network dependency of any kind: the charts are inline SVG and the styling is inline CSS. That is the whole point. A load-test result gets attached to a ticket, mailed to somebody, or opened two years later to settle an argument about when a regression started, and any of those uses is defeated by a file that needs a CDN to render.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Filename ¶
func Filename(run coordinator.Summary) string
Filename suggests a name for the downloaded file.
Types ¶
type Chart ¶
type Chart struct {
Title string
Hint string
X []time.Time
Series []Series
// Format renders a Y value for the axis and the legend.
Format func(float64) string
// Stacked draws the series as cumulative bands rather than lines.
Stacked bool
}
Chart is a time series rendered as standalone SVG.
Everything is inline — no script, no external stylesheet, no web font — so the report stays readable years later, offline, attached to a ticket.
func (Chart) Legend ¶
func (c Chart) Legend() []LegendEntry
Legend returns the series with their final values.
The value beside each swatch is what keeps identity off colour alone, which matters more in a printed or forwarded report than on screen.
type Data ¶
type Data struct {
Run coordinator.Summary
Generated time.Time
Version string
Verdict Verdict
Totals map[string]metrics.SeriesSummary
Headline []Stat
Charts []Chart
Endpoints []metrics.EndpointSummary
Failures []metrics.FailureSummary
Thresholds []coordinator.ThresholdResult
Agents []coordinator.AgentInfo
Events []coordinator.Event
Warnings []string
OmittedEnds int
}
Data is everything the template renders.
type LegendEntry ¶
LegendEntry is one row of a chart's legend.
type Series ¶
type Series struct {
Label string
Color string
// Points are aligned with the chart's X values.
Points []float64
// Fill draws a translucent area beneath the line. Single-series charts
// use it; a multi-series chart would be unreadable with eight of them.
Fill bool
}
Series is one line on a chart.