stressprofile

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package stressprofile loads and validates the YAML profiles that drive the local stress harness, including the pass/fail budgets it judges a run by.

Index

Constants

View Source
const EnvProfile = "LEVELRAIL_STRESS_PROFILE"

EnvProfile names the profile file when no path is given on the command line.

Variables

This section is empty.

Functions

This section is empty.

Types

type Profile

type Profile struct {
	Name             string        `yaml:"name"`
	Seed             uint64        `yaml:"seed"`
	Apps             int           `yaml:"apps"`
	Databases        int           `yaml:"databases"`
	Nodes            int           `yaml:"nodes"`
	SeededDeploys    int           `yaml:"seeded_deploys"`
	EnvsPerApp       int           `yaml:"envs_per_app"`
	DomainsPerApp    int           `yaml:"domains_per_app"`
	DeploysPerMinute int           `yaml:"deploys_per_minute"`
	ListClients      int           `yaml:"list_clients"`
	WatchClients     int           `yaml:"watch_clients"`
	LogLinesPerSec   int           `yaml:"log_lines_per_second"`
	Duration         time.Duration `yaml:"duration"`
	Thresholds       Thresholds    `yaml:"thresholds"`
}

Profile describes one stress run: the estate to seed, the load to apply and the budgets to hold.

func Load

func Load(path string) (Profile, error)

Load reads a profile from path, or from the file named by LEVELRAIL_STRESS_PROFILE when path is empty.

func Parse

func Parse(data []byte) (Profile, error)

Parse decodes and validates a profile, rejecting unknown keys so a typo cannot silently drop a budget.

func (Profile) PhaseSplit

func (p Profile) PhaseSplit() (steady, churn, load time.Duration)

PhaseSplit divides Duration into the steady, churn and load windows.

func (Profile) Validate

func (p Profile) Validate() error

Validate reports every problem in the profile at once.

type Thresholds

type Thresholds struct {
	P95Ms              float64 `yaml:"p95_ms"`
	P99Ms              float64 `yaml:"p99_ms"`
	MaxRSSMB           float64 `yaml:"max_rss_mb"`
	MaxGoroutines      int     `yaml:"max_goroutines"`
	MaxSQLiteMB        float64 `yaml:"max_sqlite_mb"`
	MaxReconcilePassMs float64 `yaml:"max_reconcile_pass_ms"`
	MaxErrorRatePct    float64 `yaml:"max_error_rate_pct"`
}

Thresholds are the budgets a run must stay within; every field is required.

Jump to

Keyboard shortcuts

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