sources

package
v19.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 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"`
}

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.

Jump to

Keyboard shortcuts

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