Documentation ¶
Overview ¶
Package run NOTES
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Concurrent int
Concurrent request concurrent number.
View Source
var SustainSeconds float64
SustainSeconds request sustain seconds.
View Source
var TotalRequest int64
TotalRequest is set,it has higher priority than SustainSecond
Functions ¶
Types ¶
type Limiter ¶
type Limiter struct {
// contains filtered or unexported fields
}
Limiter request number limiter.
func NewStreamLimiter ¶
NewStreamLimiter new stream limiter.
type Metrics ¶
type Metrics struct { // SustainSeconds 请求总时间 SustainSeconds float64 // Concurrent 并发数 Concurrent int // QPS ... QPS float64 // MaxDuration 单请求最大耗时 MaxDuration float64 // MinDuration 单请求最小耗时 MinDuration float64 // MedianDuration 平均时间 MedianDuration float64 // AverageDuration 请求平均耗时时间 AverageDuration float64 // Percent85Duration 处于85%位置的请求耗时 Percent85Duration float64 // Percent95Duration 处于95%位置的请求耗时 Percent95Duration float64 // TotalRequest 总请求数量 TotalRequest int64 // SucceedRequest 成功请求数量 SucceedRequest int64 // FailedRequest 失败请求数量 FailedRequest int64 // OnTheFlyRequest 波动请求数量 OnTheFlyRequest int64 }
Metrics result.
func FireLoadTest ¶
FireLoadTest exec request and statistical data.
type Reporter ¶
type Reporter struct {
Data []metricsData
}
Reporter can count Metrics data and generate reports
type Statistic ¶
type Statistic struct { // the total seconds of this statistic SustainSecond float64 // the count of goroutines to run Concurrent int // total request that has been send. TotalRequest int64 // success request number TotalSucceed int64 // failed request number TotalFailed int64 // in millisecond // only record success metrics TotalCostDuration float64 Values []float64 // Request cost duration MinCostDuration float64 MaxCostDuration float64 }
Statistic request control params.
func (*Statistic) CalculateMetrics ¶
CalculateMetrics calculate metrics.
func (*Statistic) CollectStatus ¶
CollectStatus collect request status.
func (*Statistic) IncreaseFailed ¶
func (s *Statistic) IncreaseFailed()
IncreaseFailed failed request.
func (*Statistic) IncreaseRequest ¶
func (s *Statistic) IncreaseRequest()
IncreaseRequest total request.
func (*Statistic) IncreaseSuccess ¶
func (s *Statistic) IncreaseSuccess()
IncreaseSuccess success request.
func (*Statistic) UpdateCostDuration ¶
UpdateCostDuration only update success request data
Click to show internal directories.
Click to hide internal directories.