harness

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ProfileSmall = ConcurrencyProfile{
		Name:              "P-small",
		Concurrency:       10,
		Mode2Weight:       4,
		Mode3Weight:       6,
		Tier1Share:        0.7,
		TargetSessionTime: 5 * time.Second,
		FailureRate:       0.01,
	}
	ProfileMedium = ConcurrencyProfile{
		Name:              "P-medium",
		Concurrency:       50,
		Mode2Weight:       4,
		Mode3Weight:       6,
		Tier1Share:        0.65,
		TargetSessionTime: 8 * time.Second,
		FailureRate:       0.02,
	}
	ProfileLarge = ConcurrencyProfile{
		Name:              "P-large",
		Concurrency:       200,
		Mode2Weight:       4,
		Mode3Weight:       6,
		Tier1Share:        0.60,
		TargetSessionTime: 12 * time.Second,
		FailureRate:       0.03,
	}
)

Functions

func AssertSoakThresholds

func AssertSoakThresholds(soak SoakProfile, snap *TelemetrySnapshot) error

func LoadBaseline

func LoadBaseline(path string) (map[string]float64, error)

func MetricsMap

func MetricsMap(summary *RunSummary) map[string]float64

func SaveBaseline

func SaveBaseline(path string, metrics map[string]float64) error

Types

type ArtifactBundle

type ArtifactBundle struct {
	JSONPath     string
	CSVPath      string
	MarkdownPath string
}

func WriteArtifacts

func WriteArtifacts(dir string, summary *RunSummary) (*ArtifactBundle, error)

type BenchmarkProfile

type BenchmarkProfile struct {
	Name             string
	Concurrency      int
	Iterations       int
	DatasetSizeBytes int64
}

type ConcurrencyProfile

type ConcurrencyProfile struct {
	Name              string
	Concurrency       int
	Mode2Weight       int
	Mode3Weight       int
	Tier1Share        float64
	TargetSessionTime time.Duration
	FailureRate       float64
}

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController() *Controller

func (*Controller) RunProfile

func (c *Controller) RunProfile(ctx context.Context, profile ConcurrencyProfile, workloads []Workload) (*RunSummary, error)

func (*Controller) Telemetry

func (c *Controller) Telemetry() *TelemetryCollector

type DriftReport

type DriftReport struct {
	GoroutineGrowthPct float64
	RSSGrowthPct       float64
	FDDelta            int
	RPCErrorSlopePctHr float64
}

type DriftThresholds

type DriftThresholds struct {
	GoroutineGrowthPct float64
	RSSGrowthPct       float64
	FDDeltaAbs         int
	RPCErrorSlopePctHr float64
}

type Host

type Host struct {
	Name      string `yaml:"name"`
	Address   string `yaml:"address"`
	Cores     int    `yaml:"cores"`
	RAMGB     int    `yaml:"ram_gb"`
	ZFSPoolGB int    `yaml:"zfs_pool_gb"`
}

type HostsConfig

type HostsConfig struct {
	Environments map[string][]Host `yaml:"environments"`
}

func LoadHostsConfig

func LoadHostsConfig(path string) (*HostsConfig, error)

type Regression

type Regression struct {
	Metric   string
	Baseline float64
	Current  float64
	DeltaPct float64
}

func CompareAgainstBaseline

func CompareAgainstBaseline(current map[string]float64, baseline map[string]float64, tolerancePct float64) []Regression

type RunSummary

type RunSummary struct {
	Profile            ConcurrencyProfile
	StartedAt          time.Time
	FinishedAt         time.Time
	Results            []*WorkloadResult
	Mode2Runs          int
	Mode3Runs          int
	Errors             int
	Metrics            *TelemetrySnapshot
	ContainerBootP95Ms float64
	RPCLatencyP95Ms    float64
}

type SoakProfile

type SoakProfile struct {
	Name     string
	Duration time.Duration
	Warmup   time.Duration
	Drift    DriftThresholds
}

func DefaultSoak12h

func DefaultSoak12h() SoakProfile

func DefaultSoak24h

func DefaultSoak24h() SoakProfile

type TelemetryCollector

type TelemetryCollector struct {
	// contains filtered or unexported fields
}

func NewTelemetryCollector

func NewTelemetryCollector() *TelemetryCollector

func (*TelemetryCollector) RecordContainerBoot

func (c *TelemetryCollector) RecordContainerBoot(d time.Duration)

func (*TelemetryCollector) RecordDriftSample

func (c *TelemetryCollector) RecordDriftSample(at time.Time, goroutines int, rssMB float64, fdCount int, errRate float64)

func (*TelemetryCollector) RecordRPCCount

func (c *TelemetryCollector) RecordRPCCount(n int)

func (*TelemetryCollector) RecordRPCError

func (c *TelemetryCollector) RecordRPCError(n int)

func (*TelemetryCollector) RecordRPCLatency

func (c *TelemetryCollector) RecordRPCLatency(d time.Duration)

func (*TelemetryCollector) RecordSnapshotDelta

func (c *TelemetryCollector) RecordSnapshotDelta(n int64)

func (*TelemetryCollector) Snapshot

func (c *TelemetryCollector) Snapshot() *TelemetrySnapshot

type TelemetrySnapshot

type TelemetrySnapshot struct {
	RPCLatencyP50Ms    float64
	RPCLatencyP95Ms    float64
	ContainerBootP95Ms float64
	RPCCount           int64
	RPCErrors          int64
	SnapshotDelta      int64
	Drift              DriftReport
}

type Workload

type Workload interface {
	Name() string
	Mode() string // mode2 | mode3
	Setup(ctx context.Context) error
	Run(ctx context.Context, sessionID string) (*WorkloadResult, error)
	Teardown(ctx context.Context) error
}

type WorkloadResult

type WorkloadResult struct {
	Workload   string
	Mode       string
	SessionID  string
	StartedAt  time.Time
	FinishedAt time.Time
	RPCCalls   int
	Snapshots  int
	Metadata   map[string]float64
	Err        error
}

Jump to

Keyboard shortcuts

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