benchmark

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package benchmark runs controlled, repeatable command comparisons.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Candidate

type Candidate struct {
	Name           string   `json:"name"`
	Prefix         []string `json:"prefix"`
	VersionCommand []string `json:"version_command,omitempty"`
	RequiredEnv    []string `json:"required_env,omitempty"`
	Required       bool     `json:"required,omitempty"`
}

type CandidateResult

type CandidateResult struct {
	Name        string       `json:"name"`
	Status      string       `json:"status"`
	Reason      string       `json:"reason,omitempty"`
	Command     []string     `json:"command"`
	Version     string       `json:"version,omitempty"`
	Runs        []RunResult  `json:"runs"`
	WallSeconds Distribution `json:"wall_seconds"`
}

type Distribution

type Distribution struct {
	Values []float64 `json:"values"`
	Min    float64   `json:"min"`
	Median float64   `json:"median"`
	P95    float64   `json:"p95"`
	Max    float64   `json:"max"`
}

type Host

type Host struct {
	OS   string `json:"os"`
	Arch string `json:"arch"`
}

type RunResult

type RunResult struct {
	Phase       string  `json:"phase"`
	Index       int     `json:"index"`
	WallSeconds float64 `json:"wall_seconds"`
	ExitCode    int     `json:"exit_code"`
	Log         string  `json:"log"`
}

type Spec

type Spec struct {
	SchemaVersion   int         `json:"schema_version"`
	Name            string      `json:"name"`
	ProjectDir      string      `json:"project_dir"`
	WarmupRuns      int         `json:"warmup_runs"`
	MeasuredRuns    int         `json:"measured_runs"`
	RequireClean    bool        `json:"require_clean"`
	IsolateWorktree bool        `json:"isolate_worktree"`
	Arguments       []string    `json:"arguments"`
	Candidates      []Candidate `json:"candidates"`
}

type Summary

type Summary struct {
	SchemaVersion       int               `json:"schema_version"`
	Name                string            `json:"name"`
	Commit              string            `json:"commit"`
	WorktreeFingerprint string            `json:"worktree_fingerprint"`
	Clean               bool              `json:"clean"`
	CompletedAt         string            `json:"completed_at"`
	Host                Host              `json:"host"`
	WarmupRuns          int               `json:"warmup_runs"`
	MeasuredRuns        int               `json:"measured_runs"`
	IsolatedWorktrees   bool              `json:"isolated_worktrees"`
	Arguments           []string          `json:"arguments"`
	Candidates          []CandidateResult `json:"candidates"`
}

func Run

func Run(ctx context.Context, spec Spec, outputDirectory string) (Summary, error)

func RunWithProgress

func RunWithProgress(ctx context.Context, spec Spec, outputDirectory string, progress io.Writer) (Summary, error)

Jump to

Keyboard shortcuts

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