Documentation
¶
Overview ¶
Package scenario parses YAML scenario files and exposes weighted tool-call selection and argument templating for the orchestrator.
Index ¶
Constants ¶
const DefaultTimeout = 30 * time.Second
DefaultTimeout is the per-call timeout used when neither the tool nor the workload specifies one.
Variables ¶
This section is empty.
Functions ¶
func Example ¶
func Example() string
Example returns a reference scenario document used in README and tests.
func RenderArgs ¶
RenderArgs returns a freshly-built args map with any string template placeholders rendered via text/template.
Types ¶
type Picker ¶
type Picker struct {
// contains filtered or unexported fields
}
Picker selects tools according to their weights.
type Scenario ¶
type Scenario struct {
Name string `yaml:"name"`
Transport TransportConfig `yaml:"transport"`
Workload Workload `yaml:"workload"`
Tools []ToolCall `yaml:"tools"`
}
Scenario is the top-level parsed YAML.
func ParseReader ¶
ParseReader parses a scenario from an io.Reader.
func (*Scenario) CallTimeout ¶
CallTimeout returns the effective timeout for a tool: tool override > workload timeout > DefaultTimeout.
type TemplateContext ¶
TemplateContext is the variable environment exposed to arg templates.
type ToolCall ¶
type ToolCall struct {
Name string `yaml:"name"`
Weight int `yaml:"weight"`
Args map[string]any `yaml:"args"`
Timeout time.Duration `yaml:"timeout"`
}
ToolCall is a single weighted tool invocation template.
type TransportConfig ¶
type TransportConfig struct {
Type string `yaml:"type"`
Cmd string `yaml:"cmd"`
Args []string `yaml:"args"`
Env map[string]string `yaml:"env"`
URL string `yaml:"url"`
Headers map[string]string `yaml:"headers"`
}
TransportConfig selects and configures the transport.
type Workload ¶
type Workload struct {
Rate float64 `yaml:"rate"`
Concurrency int `yaml:"concurrency"`
Duration time.Duration `yaml:"duration"`
Requests int `yaml:"requests"`
Warmup time.Duration `yaml:"warmup"`
Cooldown time.Duration `yaml:"cooldown"`
ThinkTime time.Duration `yaml:"think_time"`
Timeout time.Duration `yaml:"timeout"`
}
Workload configures the load profile.