Documentation ¶
Index ¶
- type IScenario
- type Metric
- type MetricLabel
- type Sample
- type Scenario
- func (s *Scenario) Description() string
- func (s *Scenario) GetScenarioDefinitions() map[string]StepDefinition
- func (s *Scenario) RegisterStep(name string, step StepDefinition)
- func (s *Scenario) RunStep(ctx context.Context, name string, p map[string]string, timeout time.Duration, ...) ([]Metric, error)
- func (s *Scenario) StartPrimitives()
- type ScenarioResult
- type Step
- type StepDefinition
- type StepParam
- type StepResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IScenario ¶
type IScenario interface { StartPrimitives() Init() Close() RunStep(context.Context, string, map[string]string, time.Duration, bool) ([]Metric, error) RegisterStep(string, StepDefinition) Description() string GetScenarioDefinitions() map[string]StepDefinition }
IScenario Define scenario interface
type Metric ¶
type Metric struct { ID uuid.UUID `gorm:"primaryKey;type:char(36);"` Name string Value float64 Labels map[string]string `gorm:"-"` Description string SampleID string Expires time.Duration SampleResultID uuid.UUID `json:"-"` }
Metric definition
type MetricLabel ¶
type MetricLabel struct { Key string Value string Metric Metric `gorm:"foreignKey:MetricID" json:"-"` MetricID string }
MetricLabel definition
type Sample ¶
type Sample struct { Name string Description string Tags map[string]string Scenario Scenario ScrapeInterval time.Duration `yaml:"scrapeInterval"` }
Sample represent sample scenarios
func ReadSampleYAML ¶
ReadSampleYAML Read scenarios pointer from yaml
type Scenario ¶
type Scenario struct { Kind string Steps []Step StepsDefinitions map[string]StepDefinition Context context.Context }
Scenario definition
func (*Scenario) Description ¶
Description Get scenario description
func (*Scenario) GetScenarioDefinitions ¶
func (s *Scenario) GetScenarioDefinitions() map[string]StepDefinition
GetScenarioDefinitions Get scenario definitions
func (*Scenario) RegisterStep ¶
func (s *Scenario) RegisterStep(name string, step StepDefinition)
RegisterStep Register step default method
func (*Scenario) RunStep ¶
func (s *Scenario) RunStep(ctx context.Context, name string, p map[string]string, timeout time.Duration, negate bool) ([]Metric, error)
RunStep Run an step
func (*Scenario) StartPrimitives ¶
func (s *Scenario) StartPrimitives()
StartPrimitives Initialize primitive variables
type ScenarioResult ¶
type ScenarioResult struct { Scenario Scenario StartDate time.Time EndDate time.Time StepResults []*StepResult Error error `json:"-"` ErrorString string }
ScenarioResult is the result of a scenario
type StepDefinition ¶
type StepDefinition struct { Name string Description string Params []StepParam Fn stepFn `json:"-"` }
StepDefinition definition
Click to show internal directories.
Click to hide internal directories.