-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathtypes.go
66 lines (59 loc) · 1.98 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package client
import (
"crypto/tls"
"net/http"
"github.com/schollz/progressbar/v3"
)
// Cassowary is the main struct with bootstraps the load test
type Cassowary struct {
FileMode bool
IsTLS bool
RawOutput bool
BaseURL string
ConcurrencyLevel int
Requests int
Duration int
ExportMetrics bool
ExportMetricsFile string
PromExport bool
Cloudwatch bool
Histogram bool
Boxplot bool
TLSConfig *tls.Config
PromURL string
RequestHeader []string
URLPaths []string
DisableTerminalOutput bool
DisableKeepAlive bool
Client *http.Client
Bar *progressbar.ProgressBar
Timeout int
HTTPMethod string
Data []byte
}
// ResultMetrics are the aggregated metrics after the load test
type ResultMetrics struct {
BaseURL string `json:"base_url"`
TotalRequests int `json:"total_requests"`
FailedRequests int `json:"failed_requests"`
RequestsPerSecond float64 `json:"requests_per_second"`
DNSMedian float64 `json:"dns_median"`
TCPStats tcpStats `json:"tcp_connect"`
ProcessingStats serverProcessingStats `json:"server_processing"`
ContentStats contentTransfer `json:"content_transfer"`
}
type tcpStats struct {
TCPMean float64 `json:"mean"`
TCPMedian float64 `json:"median"`
TCP95p float64 `json:"95th_percentile"`
}
type serverProcessingStats struct {
ServerProcessingMean float64 `json:"mean"`
ServerProcessingMedian float64 `json:"median"`
ServerProcessing95p float64 `json:"95th_percentile"`
}
type contentTransfer struct {
ContentTransferMean float64 `json:"mean"`
ContentTransferMedian float64 `json:"median"`
ContentTransfer95p float64 `json:"95th_percentile"`
}