Versions in this module Expand all Collapse all v1 v1.6.0 Jul 9, 2020 Changes in this version + const DefaultConcurrence + const DefaultDuration + const DefaultHatchRate + const DefaultMaxWait + const DefaultMinWait + const DefaultRequests + const StatsReportInterval + const ZeroDuration + var DefaultFastHTTPClient = &fasthttp.Client + var DefaultHTTPClient = &http.Client + var DefaultRunnerConfig = &RunnerConfig + var J = json + var LocalEventHook *eventHook + var LocalEventHookConcurrency = 200 + var LocalReportPipelineBufferSize = 10 + var LocalResultPipelineBufferSize = 1000 + var LocalRunner *localRunner + var Logger *zap.Logger + var MasterEventHook *eventHook + var MasterEventHookConcurrency = 0 + var MasterReportPipelineBufferSize = 20 + var MasterResultPipelineBufferSize = 2000 + var Message_Type_name = map[int32]string + var Message_Type_value = map[string]int32 + var SlaveEventHook *eventHook + var SlaveEventHookConcurrency = 200 + var SlaveReportPipelineBufferSize = 10 + var SlaveResultPipelineBufferSize = 1000 + func CheckFastHTTPStatusCode(resp *fasthttp.Response) error + func CheckHTTPStatusCode(resp *http.Response, body []byte) error + func RegisterUltronServer(s *grpc.Server, srv UltronServer) + func ShowLogo() + type Ack struct + func (*Ack) Descriptor() ([]byte, []int) + func (*Ack) ProtoMessage() + func (m *Ack) Reset() + func (m *Ack) String() string + type Attacker interface + Fire func() error + Name func() string + type AttackerError struct + CausedBy string + Name string + func (*AttackerError) Descriptor() ([]byte, []int) + func (*AttackerError) ProtoMessage() + func (ae *AttackerError) Error() string + func (m *AttackerError) GetCausedBy() string + func (m *AttackerError) GetName() string + func (m *AttackerError) Reset() + func (m *AttackerError) String() string + type AttackerReport struct + Average int64 + Distributions map[string]int64 + FailRatio string + FailureDetails map[string]int64 + Failures int64 + FullHistory bool + Max int64 + Median int64 + Min int64 + Name string + QPS int64 + Requests int64 + type ClientInfo struct + Id string + func (*ClientInfo) Descriptor() ([]byte, []int) + func (*ClientInfo) ProtoMessage() + func (m *ClientInfo) GetId() string + func (m *ClientInfo) Reset() + func (m *ClientInfo) String() string + type CommonFastHTTPClient interface + Do func(*fasthttp.Request, *fasthttp.Response) error + DoDeadline func(*fasthttp.Request, *fasthttp.Response, time.Time) error + DoTimeout func(*fasthttp.Request, *fasthttp.Response, time.Duration) error + type CommonHTTPClient interface + Do func(r *http.Request) (*http.Response, error) + type FastHTTPAttacker struct + CheckChain []FastHTTPResponseCheck + Client CommonFastHTTPClient + Prepare FastHTTPPrepareFunc + func NewFastHTTPAttacker(n string, p FastHTTPPrepareFunc, check ...FastHTTPResponseCheck) *FastHTTPAttacker + func (fa *FastHTTPAttacker) Fire() error + func (fa *FastHTTPAttacker) Name() string + type FastHTTPPrepareFunc func(*fasthttp.Request) error + type FastHTTPResponseCheck func(*fasthttp.Response) error + type HTTPAttacker struct + CheckChain []HTTPResponseCheck + Client CommonHTTPClient + Prepare HTTPPrepareFunc + func NewHTTPAttacker(n string, p HTTPPrepareFunc, check ...HTTPResponseCheck) *HTTPAttacker + func (ha *HTTPAttacker) Fire() error + func (ha *HTTPAttacker) Name() string + type HTTPPrepareFunc func() (*http.Request, error) + type HTTPResponseCheck func(resp *http.Response, body []byte) error + type Message struct + Data []byte + Type Message_Type + func (*Message) Descriptor() ([]byte, []int) + func (*Message) ProtoMessage() + func (m *Message) GetData() []byte + func (m *Message) GetType() Message_Type + func (m *Message) Reset() + func (m *Message) String() string + type Message_Type int32 + const Message_Disconnect + const Message_Ping + const Message_RefreshConfig + const Message_StartAttack + const Message_StopAttack + func (Message_Type) EnumDescriptor() ([]byte, []int) + func (x Message_Type) String() string + type Report map[string]*AttackerReport + type ReportHandleFunc func(Report) + type Result struct + Duration int64 + Error *AttackerError + Name string + func (*Result) Descriptor() ([]byte, []int) + func (*Result) ProtoMessage() + func (m *Result) GetDuration() int64 + func (m *Result) GetError() *AttackerError + func (m *Result) GetName() string + func (m *Result) Reset() + func (m *Result) String() string + type ResultHandleFunc func(*Result) + type Runner interface + Done func() + GetConfig func() *RunnerConfig + GetStatus func() Status + Start func() + WithConfig func(*RunnerConfig) + WithTask func(*Task) + type RunnerConfig struct + Concurrence int + Duration time.Duration + HatchRate int + MaxWait time.Duration + MinWait time.Duration + Requests uint64 + Stages []*Stage + func NewRunnerConfig() *RunnerConfig + func (rc *RunnerConfig) AppendStage(sc *Stage) *RunnerConfig + func (rc *RunnerConfig) AppendStages(sc ...*Stage) *RunnerConfig + func (rc *RunnerConfig) CurrentStage() (int, *Stage) + type Stage struct + Concurrence int + Duration time.Duration + HatchRate int + Requests uint64 + func NewStage() *Stage + type StageStatus = uint32 + const StageExpired + const StageReady + type Status = uint32 + const StatusBusy + const StatusIdle + const StatusStopped + type Task struct + func NewTask() *Task + func (t *Task) Add(a Attacker, weight int) + func (t *Task) Del(a Attacker) + type UltronClient interface + Send func(ctx context.Context, opts ...grpc.CallOption) (Ultron_SendClient, error) + Subscribe func(ctx context.Context, in *ClientInfo, opts ...grpc.CallOption) (Ultron_SubscribeClient, error) + func NewUltronClient(cc *grpc.ClientConn) UltronClient + type UltronServer interface + Send func(Ultron_SendServer) error + Subscribe func(*ClientInfo, Ultron_SubscribeServer) error + type Ultron_SendClient interface + CloseAndRecv func() (*Ack, error) + Send func(*Result) error + type Ultron_SendServer interface + Recv func() (*Result, error) + SendAndClose func(*Ack) error + type Ultron_SubscribeClient interface + Recv func() (*Message, error) + type Ultron_SubscribeServer interface + Send func(*Message) error Other modules containing this package github.com/wosai/ultron/v2