Documentation ¶
Index ¶
Constants ¶
View Source
const KST int = 3
Variables ¶
View Source
var ProviderSet = wire.NewSet(NewRequesterUsecase)
Functions ¶
This section is empty.
Types ¶
type ConstantPacer ¶
type ConstantPacer struct { Freq int // Frequency (number of occurrences) per ... Per time.Duration // Time unit, usually 1s }
A ConstantPacer defines a constant rate of hits for the target.
func (ConstantPacer) Rate ¶
func (cp ConstantPacer) Rate(elapsed time.Duration) float64
Rate returns a ConstantPacer's instantaneous hit rate (i.e. requests per second) at the given elapsed duration of an attack. Since it's constant, the return value is independent of the given elapsed duration.
func (ConstantPacer) String ¶
func (cp ConstantPacer) String() string
String returns a pretty-printed description of the ConstantPacer's behaviour:
ConstantPacer{Freq: 1, Per: time.Second} => Constant{1 hits/1s}
type DynamicParam ¶
type LinearPacer ¶
LinearPacer paces an attack by starting at a given request rate and increasing linearly with the given slope.
type Pacer ¶
type Pacer interface { // Pace returns the duration an Attacker should wait until // hitting the next Target, given an already elapsed duration and // completed hits. If the second return value is true, an attacker // should stop sending hits. Pace(elapsed time.Duration, hits uint64) (wait time.Duration, stop bool) // Rate returns a Pacer's instantaneous hit rate (per seconds) // at the given elapsed duration of an attack. Rate(elapsed time.Duration) float64 }
Pacer refer: https://github.com/tsenart/vegeta/blob/master/lib/pacer.go Pacer A Pacer defines the rate of hits during an Attack.
type Rate ¶
type Rate = ConstantPacer
Rate is a type alias for ConstantPacer for backwards-compatibility.
type Requester ¶
type Requester struct { PlanId uint64 TaskId uint64 StressType int32 StressMode int32 Num int32 StepIntervalTime int32 Nums []int32 MaxConnections int32 MaxIdleConnections int32 StressTime int32 Timeout int32 Method string Url string Headers map[string]string Query string Body string DynamicParams []*DynamicParam ResponseCheckScript string DisableKeepAlive bool H2 bool MaxBodySize int64 DisableCompression bool DisableRedirects bool Proxy string Addr string // Writer is where results will be written. If nil, results are written to stdout. Writer io.Writer StartTime int64 // contains filtered or unexported fields }
type RequesterUsecase ¶
type RequesterUsecase struct {
// contains filtered or unexported fields
}
func NewRequesterUsecase ¶
func NewRequesterUsecase(conf *conf.ServerConf, queRepository repo.QueRepository, nodeRepository repo.NodeRepository, discovery registry.Discovery) *RequesterUsecase
Click to show internal directories.
Click to hide internal directories.