Versions in this module Expand all Collapse all v1 v1.6.3 Oct 11, 2023 Changes in this version + const EVENT_CONNECTED + const EVENT_QUIT + const EVENT_SPAWN + const EVENT_STOP + var ErrParsingRampUpRate = errors.New("ratelimiter: invalid format of rampUpRate, try \"1\" or \"1/1s\"") + var Events = EventBus.New() + func GetCurrentCPUUsage() float64 + func MD5(slice ...string) string + func Now() int64 + func RecordFailure(requestType, name string, responseTime int64, exception string) + func RecordSuccess(requestType, name string, responseTime int64, responseLength int64) + func Run(tasks ...*Task) + func StartCPUProfile(file string, duration time.Duration) (err error) + func StartMemoryProfile(file string, duration time.Duration) (err error) + type Boomer struct + func NewBoomer(masterHost string, masterPort int) *Boomer + func NewStandaloneBoomer(spawnCount int, spawnRate float64) *Boomer + func (b *Boomer) AddOutput(o Output) + func (b *Boomer) EnableCPUProfile(cpuProfileFile string, duration time.Duration) + func (b *Boomer) EnableMemoryProfile(memoryProfileFile string, duration time.Duration) + func (b *Boomer) Quit() + func (b *Boomer) RecordFailure(requestType, name string, responseTime int64, exception string) + func (b *Boomer) RecordSuccess(requestType, name string, responseTime int64, responseLength int64) + func (b *Boomer) Run(tasks ...*Task) + func (b *Boomer) SendCustomMessage(messageType string, data interface{}) + func (b *Boomer) SetMode(mode Mode) + func (b *Boomer) SetRateLimiter(rateLimiter RateLimiter) + func (b *Boomer) WithLogger(logger *log.Logger) *Boomer + type ConsoleOutput struct + func NewConsoleOutput() *ConsoleOutput + func (o *ConsoleOutput) OnEvent(data map[string]interface{}) + func (o *ConsoleOutput) OnStart() + func (o *ConsoleOutput) OnStop() + func (o *ConsoleOutput) WithLogger(logger *log.Logger) *ConsoleOutput + type CustomMessage struct + Data interface{} + NodeID string + Type string + type MockGomqDealer struct + var MockGomqDealerInstance *MockGomqDealer = &MockGomqDealer{ ... } + func (m *MockGomqDealer) AddConnection(*gomq.Connection) + func (m *MockGomqDealer) Close() + func (m *MockGomqDealer) Connect(add string) (err error) + func (m *MockGomqDealer) Recv() ([]byte, error) + func (m *MockGomqDealer) RecvChannel() chan *zmtp.Message + func (m *MockGomqDealer) RecvMultipart() ([][]byte, error) + func (m *MockGomqDealer) RemoveConnection(string) + func (m *MockGomqDealer) RetryInterval() time.Duration + func (m *MockGomqDealer) SecurityMechanism() zmtp.SecurityMechanism + func (m *MockGomqDealer) Send(payload []byte) (err error) + func (m *MockGomqDealer) SendChannel() chan []byte + func (m *MockGomqDealer) SendMultipart(payload [][]byte) (err error) + func (m *MockGomqDealer) SetConnectError(err error) + func (m *MockGomqDealer) SocketIdentity() zmtp.SocketIdentity + func (m *MockGomqDealer) SocketType() zmtp.SocketType + type Mode int + const DistributedMode + const StandaloneMode + type Output interface + OnEvent func(data map[string]interface{}) + OnStart func() + OnStop func() + type PrometheusPusherOutput struct + func NewPrometheusPusherOutput(gatewayURL, jobName string) *PrometheusPusherOutput + func (o *PrometheusPusherOutput) OnEvent(data map[string]interface{}) + func (o *PrometheusPusherOutput) OnStart() + func (o *PrometheusPusherOutput) OnStop() + func (o *PrometheusPusherOutput) WithLogger(logger *log.Logger) *PrometheusPusherOutput + type RampUpRateLimiter struct + func NewRampUpRateLimiter(maxThreshold int64, rampUpRate string, refillPeriod time.Duration) (rateLimiter *RampUpRateLimiter, err error) + func (limiter *RampUpRateLimiter) Acquire() (blocked bool) + func (limiter *RampUpRateLimiter) Start() + func (limiter *RampUpRateLimiter) Stop() + type RateLimiter interface + Acquire func() bool + Start func() + Stop func() + type SmoothRoundRobinTaskSet struct + func NewSmoothRoundRobinTaskSet() *SmoothRoundRobinTaskSet + func (ts *SmoothRoundRobinTaskSet) AddTask(task *Task) + func (ts *SmoothRoundRobinTaskSet) GetTask() (task *Task) + func (ts *SmoothRoundRobinTaskSet) GetWeight() (weight int) + func (ts *SmoothRoundRobinTaskSet) Run() + func (ts *SmoothRoundRobinTaskSet) SetWeight(weight int) + type StableRateLimiter struct + func NewStableRateLimiter(threshold int64, refillPeriod time.Duration) (rateLimiter *StableRateLimiter) + func (limiter *StableRateLimiter) Acquire() (blocked bool) + func (limiter *StableRateLimiter) Start() + func (limiter *StableRateLimiter) Stop() + type Task struct + Fn func() + Name string + Weight int + type TaskSet interface + AddTask func(task *Task) + GetWeight func() (weight int) + Run func() + SetWeight func(weight int) + type WeighingTaskSet struct + func NewWeighingTaskSet() *WeighingTaskSet + func (ts *WeighingTaskSet) AddTask(task *Task) + func (ts *WeighingTaskSet) GetTask(roll int) (task *Task) + func (ts *WeighingTaskSet) GetWeight() (weight int) + func (ts *WeighingTaskSet) Run() + func (ts *WeighingTaskSet) SetWeight(weight int)