Documentation
¶
Index ¶
- Constants
- func Run(testConfigPath string, trogdorCoordinatorHost string, trogdorAgentsCount int, ...)
- type ConnectionStress
- func (cs *ConnectionStress) CreateTest(trogdorAgentsCount int, bootstrapServers string) (tasks []trogdor.TaskSpec, err error)
- func (cs *ConnectionStress) GetDuration() time.Duration
- func (cs *ConnectionStress) GetEndTime() (time.Time, error)
- func (cs *ConnectionStress) GetName() string
- func (cs *ConnectionStress) GetStartTime() (time.Time, error)
- func (cs *ConnectionStress) SetEndTime(endTime time.Time)
- func (cs *ConnectionStress) SetStartTime(startTime time.Time)
- type NotEnoughContextError
- type PerformanceTestConfig
- type ScenarioContext
- type ScenarioTestConfig
- type SchedulableTest
- type Schedule
- type ScheduleDef
- type Step
- type SustainedConnection
- func (sc *SustainedConnection) CreateTest(trogdorAgentsCount int, bootstrapServers string) (tasks []trogdor.TaskSpec, err error)
- func (sc *SustainedConnection) GetDuration() time.Duration
- func (sc *SustainedConnection) GetEndTime() (time.Time, error)
- func (sc *SustainedConnection) GetName() string
- func (sc *SustainedConnection) GetStartTime() (time.Time, error)
- func (sc *SustainedConnection) SetEndTime(endTime time.Time)
- func (sc *SustainedConnection) SetStartTime(startTime time.Time)
- type TailConsumer
- func (tc *TailConsumer) CreateTest(trogdorAgentsCount int, bootstrapServers string) (tasks []trogdor.TaskSpec, err error)
- func (tc *TailConsumer) GetDuration() time.Duration
- func (tc *TailConsumer) GetEndTime() (time.Time, error)
- func (tc *TailConsumer) GetName() string
- func (tc *TailConsumer) GetStartTime() (time.Time, error)
- func (tc *TailConsumer) SetEndTime(endTime time.Time)
- func (tc *TailConsumer) SetStartTime(startTime time.Time)
- type TestWithTopics
- type Workload
- func (workload *Workload) CreateTest(trogdorAgentsCount int, bootstrapServers string) (tasks []trogdor.TaskSpec, err error)
- func (workload *Workload) GetDuration() time.Duration
- func (workload *Workload) GetEndTime() (time.Time, error)
- func (workload *Workload) GetName() string
- func (workload *Workload) GetStartTime() (time.Time, error)
- func (workload *Workload) SetEndTime(endTime time.Time)
- func (workload *Workload) SetStartTime(startTime time.Time)
- func (workload *Workload) TopicNames() []string
Constants ¶
const CONNECTION_STRESS_TEST_TYPE = "ConnectionStress"
const PRODUCE_WORKLOAD_TYPE = "Produce"
const PROGRESSIVE_WORKLOAD_TEST_TYPE = "ProgressiveWorkload"
const SUSTAINED_CONNECTION_TEST_TYPE = "SustainedConnection"
const TAIL_CONSUMER_TEST_TYPE = "TailConsume"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConnectionStress ¶
type ConnectionStress struct { Name string Duration common.Duration `json:"duration"` TargetConnectionsPerSec int `json:"target_connections_per_sec"` NumThreads int `json:"num_threads"` Fanout int `json:"fanout"` TasksPerStep int `json:"tasks_per_step"` Action string `json:"action"` SlowStartPerStepMs uint64 `json:"slow_start_per_step_ms"` // contains filtered or unexported fields }
func (*ConnectionStress) CreateTest ¶
func (*ConnectionStress) GetDuration ¶
func (cs *ConnectionStress) GetDuration() time.Duration
func (*ConnectionStress) GetEndTime ¶
func (cs *ConnectionStress) GetEndTime() (time.Time, error)
func (*ConnectionStress) GetName ¶
func (cs *ConnectionStress) GetName() string
func (*ConnectionStress) GetStartTime ¶
func (cs *ConnectionStress) GetStartTime() (time.Time, error)
func (*ConnectionStress) SetEndTime ¶
func (cs *ConnectionStress) SetEndTime(endTime time.Time)
func (*ConnectionStress) SetStartTime ¶
func (cs *ConnectionStress) SetStartTime(startTime time.Time)
type NotEnoughContextError ¶
type NotEnoughContextError struct {
// contains filtered or unexported fields
}
the NotEnoughContextError error indicates that a test needs more than the provided scenario context to be parsed correctly
func (*NotEnoughContextError) Error ¶
func (nec *NotEnoughContextError) Error() string
type PerformanceTestConfig ¶
type PerformanceTestConfig struct { Type string `json:"test_type"` Name string `json:"test_name"` Parameters json.RawMessage `json:"test_parameters"` // contains filtered or unexported fields }
PerformanceTestConfig is a generic definition of a test. It it meant to support different types of tests, each of which define their own set of test_parameters Each test should implement the SchedulableTest interface
func (*PerformanceTestConfig) CreateTest ¶
func (*PerformanceTestConfig) ParseTest ¶
func (ptc *PerformanceTestConfig) ParseTest(context *ScenarioContext) error
ParseTest() parses the configuration into the concrete test struct it can return a retriable error of type NotEnoughContext which means that we should try parsing this test again when we have more context from the scenario Parsing will be done only once, if successful
type ScenarioContext ¶
type ScenarioContext struct { TestsWithTopics map[string]TestWithTopics SchedulableTests map[string]SchedulableTest }
ScenarioContext holds the tests that are parsed for this scenario run
func (*ScenarioContext) AddSchedulableTest ¶
func (sc *ScenarioContext) AddSchedulableTest(st SchedulableTest)
func (*ScenarioContext) AddTestWithTopics ¶
func (sc *ScenarioContext) AddTestWithTopics(twt TestWithTopics)
type ScenarioTestConfig ¶
type ScenarioTestConfig struct { Name string `json:"scenario_name"` TestDefinitions []*PerformanceTestConfig `json:"test_definitions"` ScheduleDefinition ScheduleDef `json:"schedule"` // contains filtered or unexported fields }
ScenarioTestConfig is the top-most definition for all the performance tests scheduled to run
func (*ScenarioTestConfig) CreateSchedules ¶
func (sct *ScenarioTestConfig) CreateSchedules(startTime time.Time) error
CreateSchedules() parses the user-defined scheduling and sets each test's startTime/endTime accordingly
func (*ScenarioTestConfig) CreateTests ¶
func (sct *ScenarioTestConfig) CreateTests(trogdorAgentsCount int, bootstrapServers string) ([]trogdor.TaskSpec, error)
CreateTests() creates all the Trogdor tasks for each test that is part of this scenario. It requires that the config is parsed and that the schedules are created
func (*ScenarioTestConfig) ParseConfig ¶
func (sct *ScenarioTestConfig) ParseConfig(configPath string) error
type SchedulableTest ¶
type SchedulableTest interface { // CreateTest() should return Trogdor task specifications that compose the whole test. // Said tasks should start no earlier than GetStartTime(), // should have at least one tasks that ends at GetEndTime() and none ending later than that. CreateTest(trogdorAgentsCount int, bootstrapServers string) ([]trogdor.TaskSpec, error) GetName() string // returns the duration of the test. If the test is scheduled to run until another test, this method should return 0 GetDuration() time.Duration // returns an error if StartTime is not set GetStartTime() (time.Time, error) // returns an error if EndTime is not set GetEndTime() (time.Time, error) SetStartTime(time.Time) SetEndTime(time.Time) }
SchedulableTest is an interface for a test that is schedulable. To be eligible for scheduling, the test should have a known duration time or be scheduled to run until a test with a known duration time. After the scheduling is determined, the start and end times of the test
will be set via the appropriate methods
type ScheduleDef ¶
type Step ¶
type Step struct {
// contains filtered or unexported fields
}
a Step is a part of a Workload. It is to be converted to multiple Trogdor tasks which in combination achieve the desired throughput
type SustainedConnection ¶
type SustainedConnection struct { Name string Duration common.Duration `json:"duration"` ProducerConnectionCount uint64 `json:"producer_connection_count"` ConsumerConnectionCount uint64 `json:"consumer_connection_count"` MetadataConnectionCount uint64 `json:"metadata_connection_count"` NumThreads uint64 `json:"num_threads"` Fanout int `json:"fanout"` TasksPerStep int `json:"tasks_per_step"` RefreshRateMs uint64 `json:"refresh_rate_ms"` TopicName string `json:"topic_name"` MessageSizeBytes uint64 `json:"message_size_bytes"` SlowStartPerStepMs uint64 `json:"slow_start_per_step_ms"` // contains filtered or unexported fields }
func (*SustainedConnection) CreateTest ¶
func (*SustainedConnection) GetDuration ¶
func (sc *SustainedConnection) GetDuration() time.Duration
func (*SustainedConnection) GetEndTime ¶
func (sc *SustainedConnection) GetEndTime() (time.Time, error)
func (*SustainedConnection) GetName ¶
func (sc *SustainedConnection) GetName() string
func (*SustainedConnection) GetStartTime ¶
func (sc *SustainedConnection) GetStartTime() (time.Time, error)
func (*SustainedConnection) SetEndTime ¶
func (sc *SustainedConnection) SetEndTime(endTime time.Time)
func (*SustainedConnection) SetStartTime ¶
func (sc *SustainedConnection) SetStartTime(startTime time.Time)
type TailConsumer ¶
type TailConsumer struct { Name string // the ProduceTestName must refer to a test that implements the TopicWithTests interface ProduceTestName string `json:"topics_from_test"` Fanout int `json:"fanout"` Topics []string `json:"topics"` Duration common.Duration `json:"duration"` StepMessagesPerSecond uint64 `json:"step_messages_per_second"` TasksPerStep int `json:"tasks_per_step"` SlowStartPerStepMs uint64 `json:"slow_start_per_step_ms"` ConsumerGroup string `json:"consumer_group"` // contains filtered or unexported fields }
func (*TailConsumer) CreateTest ¶
func (*TailConsumer) GetDuration ¶
func (tc *TailConsumer) GetDuration() time.Duration
func (*TailConsumer) GetEndTime ¶
func (tc *TailConsumer) GetEndTime() (time.Time, error)
func (*TailConsumer) GetName ¶
func (tc *TailConsumer) GetName() string
func (*TailConsumer) GetStartTime ¶
func (tc *TailConsumer) GetStartTime() (time.Time, error)
func (*TailConsumer) SetEndTime ¶
func (tc *TailConsumer) SetEndTime(endTime time.Time)
func (*TailConsumer) SetStartTime ¶
func (tc *TailConsumer) SetStartTime(startTime time.Time)
type TestWithTopics ¶
type TestWithTopics interface { GetName() string // TopicNames() should return all the topics this test will use TopicNames() []string }
TestWithTopics is an interface for a test that makes use of topics.
type Workload ¶
type Workload struct { Name string Type string `json:"workload_type"` PartitionCount uint64 `json:"partition_count"` StepDurationMs uint64 `json:"step_duration_ms"` StepCooldownMs uint64 `json:"step_cooldown_ms"` StartThroughputMbs float32 `json:"start_throughput_mbs"` EndThroughputMbs float32 `json:"end_throughput_mbs"` ThroughputIncreaseMbs float32 `json:"throughput_increase_per_step_mbs"` MessageSizeBytes uint64 `json:"message_size_bytes"` MessagePaddingBytes uint64 `json:"message_padding_bytes"` TasksPerStep int `json:"tasks_per_step"` SlowStartPerStepMs uint64 `json:"slow_start_per_step_ms"` TopicName string `json:"topic_name"` // contains filtered or unexported fields }
func (*Workload) CreateTest ¶
func (workload *Workload) CreateTest(trogdorAgentsCount int, bootstrapServers string) (tasks []trogdor.TaskSpec, err error)
Returns all the Trogdor tasks that should be ran as part of this workload