sources

package
v19.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdversarialSource added in v19.4.0

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

AdversarialSource produces Units that probe the engine's documented error surface: every drive op is a send the engine must refuse, either addressed with a forged channel token or carrying a value over the channel size cap. The flow itself only sleeps, so it is expected to complete untouched and a unit fails only when the engine answers a send differently than documented.

func NewAdversarialSource added in v19.4.0

func NewAdversarialSource() *AdversarialSource

func (*AdversarialSource) Name added in v19.4.0

func (s *AdversarialSource) Name() string

func (*AdversarialSource) NextUnit added in v19.4.0

func (s *AdversarialSource) NextUnit(rng *rand.Rand) (*flowtest.Unit, error)

type AdversarialSourceConfig added in v19.4.0

type AdversarialSourceConfig struct {
	Weight int `json:"weight"`
}

AdversarialSourceConfig configures the adversarial source's share in the Driver's unit mix.

type CorpusSource

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

CorpusSource produces pre-defined Units, picked uniformly.

func NewCorpusSource

func NewCorpusSource(units []*flowtest.Unit) (*CorpusSource, error)

func (*CorpusSource) Name

func (s *CorpusSource) Name() string

func (*CorpusSource) NextUnit

func (s *CorpusSource) NextUnit(rng *rand.Rand) (*flowtest.Unit, error)

type CorpusSourceConfig

type CorpusSourceConfig struct {
	Weight int `json:"weight"`
}

CorpusSourceConfig configures the corpus source's share in the Driver's unit mix.

type FlowgenSource added in v19.4.0

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

FlowgenSource synthesizes a fresh Unit per session from the flowgen grammar.

func NewFlowgenSource added in v19.4.0

func NewFlowgenSource(cfg flowgen.Config) (*FlowgenSource, error)

NewFlowgenSource validates cfg by generating one probe unit from a fixed-seed RNG, so config errors surface at startup; the probe is discarded.

func (*FlowgenSource) Name added in v19.4.0

func (s *FlowgenSource) Name() string

func (*FlowgenSource) NextUnit added in v19.4.0

func (s *FlowgenSource) NextUnit(rng *rand.Rand) (*flowtest.Unit, error)

type FlowgenSourceConfig added in v19.4.0

type FlowgenSourceConfig struct {
	Weight            int     `json:"weight"`
	MaxBlocks         int     `json:"max_blocks"`
	MaxChannels       int     `json:"max_channels"`
	DurationScale     float64 `json:"duration_scale"`
	CancelProbability float64 `json:"cancel_probability"`
	FailProbability   float64 `json:"fail_probability"`
	// Swarm draws this replica's own per-kind weight table from the swarm seed
	// Build is called with, so the fleet covers many statistical mixes of the
	// grammar at once instead of one. Each unit's provenance records the drawn
	// table, so a swarmed session stays exactly re-renderable.
	Swarm bool `json:"swarm"`
}

FlowgenSourceConfig configures a FlowgenSource and its share in the Driver's unit mix. Zero values use the flowgen defaults. Per-kind block weights stay internal to the grammar; the cancel and fail probabilities are exposed, because they are what changes a unit's expected outcome, so each workload picks its own share.

type RateConfig

type RateConfig struct {
	MinPerReplica int    `json:"min_per_replica"`
	MaxPerReplica int    `json:"max_per_replica"`
	Period        string `json:"period"`
	// contains filtered or unexported fields
}

RateConfig configures the per-replica submission rate envelope.

type ScenarioParams

type ScenarioParams struct {
	Weight   int     `json:"weight"`
	FailProb float32 `json:"fail_prob"`
}

ScenarioParams configures one scenario's share in a ScenarioSource.

type ScenarioSource

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

ScenarioSource produces Units that execute Go scenarios from the scenario library, picked by configured weight.

func NewScenarioSource

func NewScenarioSource(params map[string]ScenarioParams) (*ScenarioSource, error)

NewScenarioSource resolves params against the registered scenario library.

func (*ScenarioSource) Name

func (s *ScenarioSource) Name() string

func (*ScenarioSource) NextUnit

func (s *ScenarioSource) NextUnit(rng *rand.Rand) (*flowtest.Unit, error)

type ScenariosSourceConfig

type ScenariosSourceConfig struct {
	Weight    int                       `json:"weight"`
	Scenarios map[string]ScenarioParams `json:"scenarios"`
}

ScenariosSourceConfig configures a ScenarioSource and its share in the Driver's unit mix.

type SourcesConfig

type SourcesConfig struct {
	Scenarios   *ScenariosSourceConfig   `json:"scenarios"`
	Corpus      *CorpusSourceConfig      `json:"corpus"`
	Flowgen     *FlowgenSourceConfig     `json:"flowgen"`
	Adversarial *AdversarialSourceConfig `json:"adversarial"`
}

SourcesConfig holds one optional config block per known source type.

type WorkloadConfig

type WorkloadConfig struct {
	Rate    RateConfig    `json:"rate"`
	Sources SourcesConfig `json:"sources"`
}

WorkloadConfig is the YAML workload definition for the flowtest Driver: the per-replica rate envelope and the weighted source mix.

func Load

func Load(path string) (*WorkloadConfig, error)

Load reads and parses a workload config file.

func Parse

func Parse(data []byte) (*WorkloadConfig, error)

Parse parses a workload config and applies rate defaults: min defaults to 10, max is floored to min, period defaults to 10m and must parse positive.

func (*WorkloadConfig) Build

Build resolves the config into Driver inputs. The rate model uses the shared DefaultRateSeed so all replicas compute the same macro rate curve; swarmSeed conversely is per-replica, so a swarming flowgen source draws a weight table only this replica generates from.

Jump to

Keyboard shortcuts

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