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
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 ¶
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
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 ¶
func (c *WorkloadConfig) Build() ([]flowtest.WeightedSource, flowtest.RateModel, error)
Build resolves the config into Driver inputs. The rate model uses the shared DefaultRateSeed so all replicas compute the same macro rate curve.