Documentation
¶
Index ¶
- Constants
- func FormatDuration(d time.Duration) string
- func FormatLoadHeader(meta LoadRunMeta) string
- func FormatLoadTable(report LoadReport) string
- func LoadStatusClassFromProto(class load_metricsv1.LoadStatusClass) loadmetrics.StatusClass
- func LoadStatusClassToProto(class loadmetrics.StatusClass) load_metricsv1.LoadStatusClass
- type FlowStartInfo
- type LoadReport
- type LoadRunMeta
- type NodeStatusEvent
- type ReportSpec
- type Reporter
- type ReporterGroup
- func (g *ReporterGroup) Flush() error
- func (g *ReporterGroup) HandleFlowResult(result model.FlowRunResult)
- func (g *ReporterGroup) HandleFlowStart(info FlowStartInfo)
- func (g *ReporterGroup) HandleNodeStatus(event NodeStatusEvent)
- func (g *ReporterGroup) HasConsole() bool
- func (g *ReporterGroup) SetLoadReport(report *LoadReport)
- type ReporterOptions
Constants ¶
const ( ReportFormatConsole = "console" ReportFormatJSON = "json" ReportFormatJUnit = "junit" )
const LoadMetricsScope = "Counts HTTP request steps only; GraphQL, WebSocket and sub-flow steps run but are neither counted nor memory-bounded."
LoadMetricsScope states what a load run measures, and by extension what it keeps memory-flat. It is surfaced in both the console output and the JSON report so nobody has to infer the boundary from a suspiciously empty table.
Variables ¶
This section is empty.
Functions ¶
func FormatDuration ¶
FormatDuration formats a duration for display
func FormatLoadHeader ¶
func FormatLoadHeader(meta LoadRunMeta) string
FormatLoadHeader renders the one-off context lines printed above the table. It is deliberately separate so the table itself stays exactly as published.
func FormatLoadTable ¶
func FormatLoadTable(report LoadReport) string
FormatLoadTable renders the aggregate console table: one row per step plus a TOTAL row, sorted by step name so the output is stable across runs.
func LoadStatusClassFromProto ¶
func LoadStatusClassFromProto(class load_metricsv1.LoadStatusClass) loadmetrics.StatusClass
LoadStatusClassFromProto is the inverse of LoadStatusClassToProto. UNSPECIFIED, and any value this build does not know, yield "".
func LoadStatusClassToProto ¶
func LoadStatusClassToProto(class loadmetrics.StatusClass) load_metricsv1.LoadStatusClass
LoadStatusClassToProto converts an aggregation status class to the wire enum. An unrecognized class yields UNSPECIFIED rather than guessing.
Types ¶
type FlowStartInfo ¶
type LoadReport ¶
type LoadReport struct {
Meta LoadRunMeta
Report loadmetrics.Report
ByStep loadmetrics.Report
}
LoadReport is a completed load run in the shape the reporters need: metadata, the full (step, status-class) breakdown, and the same data folded to one row per step for the console table.
type LoadRunMeta ¶
type LoadRunMeta struct {
// ScenarioName is the `load:` block entry the profile came from, empty
// for a run configured entirely from flags.
ScenarioName string
FlowName string
VUs int
// Duration and MaxIterations are the configured stop conditions.
Duration time.Duration
MaxIterations int64
// Iterations, Errors and Elapsed are what actually happened.
Iterations int64
Errors int64
Elapsed time.Duration
// WorkerVersion identifies the binary that produced the numbers, so
// baselines from different builds are not silently compared.
WorkerVersion string
}
LoadRunMeta describes the load run that produced a report: which profile ran, and what the scheduler actually managed to do.
type NodeStatusEvent ¶
type NodeStatusEvent struct {
FlowID string
FlowName string
Status runner.FlowNodeStatus
}
type ReportSpec ¶
func ParseReportSpecs ¶
func ParseReportSpecs(values []string) ([]ReportSpec, error)
type Reporter ¶
type Reporter interface {
HandleFlowStart(info FlowStartInfo)
HandleNodeStatus(event NodeStatusEvent)
HandleFlowResult(result model.FlowRunResult)
Flush() error
}
type ReporterGroup ¶
type ReporterGroup struct {
// contains filtered or unexported fields
}
func NewReporterGroup ¶
func NewReporterGroup(specs []ReportSpec, opts ReporterOptions) (*ReporterGroup, error)
func (*ReporterGroup) Flush ¶
func (g *ReporterGroup) Flush() error
func (*ReporterGroup) HandleFlowResult ¶
func (g *ReporterGroup) HandleFlowResult(result model.FlowRunResult)
func (*ReporterGroup) HandleFlowStart ¶
func (g *ReporterGroup) HandleFlowStart(info FlowStartInfo)
func (*ReporterGroup) HandleNodeStatus ¶
func (g *ReporterGroup) HandleNodeStatus(event NodeStatusEvent)
func (*ReporterGroup) HasConsole ¶
func (g *ReporterGroup) HasConsole() bool
func (*ReporterGroup) SetLoadReport ¶
func (g *ReporterGroup) SetLoadReport(report *LoadReport)
SetLoadReport hands the load report to every reporter that can use it. It must be called before Flush. Reporters that never receive one behave exactly as they did before load mode existed.
type ReporterOptions ¶
type ReporterOptions struct {
ShowOutput bool // Show node output data in console reporter
}
ReporterOptions contains configuration options for reporters.