report

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package report renders aggregate summaries into human, json, csv, and prometheus text-exposition formats.

Index

Constants

View Source
const Version = "mcpbench/v1"

Version is the current on-disk format version for RunFile JSON.

Variables

This section is empty.

Functions

func Write

func Write(w io.Writer, format Format, rf *RunFile) error

Write dispatches to the format-specific writer.

func WriteCSV

func WriteCSV(w io.Writer, rf *RunFile) error

WriteCSV writes a CSV with one row per tool (plus a synthetic __overall__).

func WriteHuman

func WriteHuman(w io.Writer, rf *RunFile) error

WriteHuman renders a tabular human-readable report.

func WriteJSON

func WriteJSON(w io.Writer, rf *RunFile) error

WriteJSON writes the full run as indented JSON.

func WritePrometheus

func WritePrometheus(w io.Writer, rf *RunFile) error

WritePrometheus emits a text-exposition document compatible with prometheus scrape and most TSDBs' textfile import.

Types

type Format

type Format string

Format enumerates supported output formats.

const (
	FormatHuman      Format = "human"
	FormatJSON       Format = "json"
	FormatCSV        Format = "csv"
	FormatPrometheus Format = "prom"
)

Known formats.

func ParseFormat

func ParseFormat(s string) (Format, error)

ParseFormat normalizes a user-provided format name.

type RunFile

type RunFile struct {
	Version    string                   `json:"version"`
	Scenario   string                   `json:"scenario"`
	StartedAt  time.Time                `json:"started_at"`
	EndedAt    time.Time                `json:"ended_at"`
	Throughput float64                  `json:"throughput_per_sec"`
	Summary    metrics.AggregateSummary `json:"summary"`
}

RunFile is the JSON-serialized representation of a completed run. Keep in sync with internal/compare.RunFile.

Jump to

Keyboard shortcuts

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