Documentation
¶
Index ¶
- type Client
- type Config
- type Latencies
- func (own *Latencies) Append(latency time.Duration)
- func (own *Latencies) CountTotalLatency() time.Duration
- func (own *Latencies) GetLatencies() []time.Duration
- func (own *Latencies) GetPercentile(percentile int) time.Duration
- func (own *Latencies) Len() int
- func (own *Latencies) Less(i, j int) bool
- func (own *Latencies) Swap(i, j int)
- type Metrics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Method string // 请求方法
URL string // 请求URL
Headers map[string]string // 请求头
Body string // 请求体
Concurrent int // 并发请求数
TotalRequests int // 总请求数
Timeout time.Duration // 请求超时时间
KeepAlive bool // 是否保持连接
}
Config 定义性能测试配置的数据结构
type Latencies ¶
type Latencies struct {
// contains filtered or unexported fields
}
func NewLatencies ¶
func NewLatencies() *Latencies
func (*Latencies) CountTotalLatency ¶
func (*Latencies) GetLatencies ¶
type Metrics ¶
type Metrics struct {
StartTime time.Time // 开始时间
EndTime time.Time // 结束事件
TotalRequests int64 // 总请求数
SuccessCount int64 // 成功请求数
FailedCount int64 // 失败请求数
ErrorCount int64 // 错误总数
Latencies *Latencies // 延迟数据
StatusCodes map[int]int64 // 状态码数据
// contains filtered or unexported fields
}
Metrics 定义性能测试各项指标的数据结构
Click to show internal directories.
Click to hide internal directories.