report

package
v0.0.0-...-cd097ab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasFailures

func HasFailures(doc Document) bool

HasFailures reports whether a document has no workloads or any workload failed.

func WriteCompare

func WriteCompare(w io.Writer, docs []Document) error

WriteCompare writes a side-by-side comparison of two or more reports.

func WriteConsole

func WriteConsole(w io.Writer, doc Document) error

WriteConsole writes a human-readable summary to w.

func WriteHTML

func WriteHTML(w io.Writer, doc Document) error

WriteHTML writes a standalone HTML report.

func WriteJSON

func WriteJSON(w io.Writer, doc Document) error

WriteJSON writes a formatted JSON report to w.

Types

type Document

type Document struct {
	SchemaVersion int                `json:"schema_version"`
	Version       string             `json:"version"`
	Timestamp     time.Time          `json:"timestamp"`
	System        sysinfo.SystemInfo `json:"system"`
	Config        RunConfig          `json:"config"`
	Results       ResultsSection     `json:"results"`
	Extensions    ExtensionsSection  `json:"extensions,omitempty"`
	Warnings      []string           `json:"warnings,omitempty"`
}

Document is the full report representation shared by JSON and HTML outputs.

func BuildDocument

func BuildDocument(version string, system sysinfo.SystemInfo, cfg RunConfig, results []bench.BenchResult, warnings []string) Document

BuildDocument converts benchmark results into a report document.

type ExtensionsSection

type ExtensionsSection struct {
	Workloads []WorkloadEntry `json:"workloads,omitempty"`
}

ExtensionsSection stores optional extension workloads.

type ResultEntry

type ResultEntry struct {
	Iterations       int       `json:"iterations,omitempty"`
	MedianMS         float64   `json:"median_ms"`
	SamplesMS        []float64 `json:"samples_ms,omitempty"`
	ThroughputPerSec float64   `json:"throughput_per_sec"`
	ThroughputUnit   string    `json:"throughput_unit"`
	AvgNSPerAccess   float64   `json:"avg_ns_per_access,omitempty"`
	BytesProcessed   int64     `json:"bytes_processed,omitempty"`
	OpsProcessed     float64   `json:"ops_processed,omitempty"`
	Detail           string    `json:"detail,omitempty"`
	Error            string    `json:"error,omitempty"`
}

ResultEntry stores one workload result inside a report document.

type ResultsSection

type ResultsSection struct {
	Workloads []WorkloadEntry `json:"workloads"`
}

ResultsSection stores benchmark workload results without synthetic scoring.

type RunConfig

type RunConfig struct {
	Iterations      int      `json:"iterations"`
	Filter          string   `json:"filter,omitempty"`
	DiskPath        string   `json:"disk_path,omitempty"`
	Extensions      bool     `json:"extensions"`
	Mode            string   `json:"mode,omitempty"`
	Scope           string   `json:"scope,omitempty"`
	HardwareTools   []string `json:"hardware_tools,omitempty"`
	IperfHosts      []string `json:"iperf_hosts,omitempty"`
	CatalogSource   string   `json:"catalog_source,omitempty"`
	CatalogRevision string   `json:"catalog_revision,omitempty"`
	NodeIDs         []string `json:"node_ids,omitempty"`
}

RunConfig describes the CLI configuration used to produce a report.

type WorkloadEntry

type WorkloadEntry struct {
	Name        string       `json:"name"`
	Category    string       `json:"category"`
	Description string       `json:"description"`
	Result      *ResultEntry `json:"result,omitempty"`
}

WorkloadEntry stores one workload report row.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL