Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct {
Index, Code int
Took float64
Error error
TotalLength int64
ContentLength int64
HeaderLength int64
}
Result is the performance test result transporter.
type Results ¶
type Results struct { Requested int Replies int TotalTime float64 ConnPerSec float64 Took []float64 TookMin float64 TookMed float64 TookAvg float64 TookMax float64 Took85th float64 Took90th float64 Took95th float64 Took99th float64 Code []int Code1xx int Code2xx int Code3xx int Code4xx int Code5xx int Errors []error ErrorsTotal int ErrorsConnTimeout int ErrorsConnRefused int ErrorsConnReset int ErrorsOther int ContentLength int64 HeaderLength int64 TotalLength int64 }
Results is a container for the performance test results.
Example ¶
// This should typically not be created manaully, but rather by // Connector{}.New( ... ) r := Results{ Took: make([]float64, 10), Code: make([]int, 10), } t := Result{ Index: 0, Took: 300.0, Code: 200, } r.Add(t) // If running this manually, as opposed to via (*Connector{}).Run() // you must finalize to create max, min, avg, etc. r.Finalize() fmt.Printf("Took: %f\n", r.Took[0]) fmt.Printf("Code: %d\n", r.Code[0]) fmt.Printf("Max: %f\n", r.TookMax)
Output: Took: 300.000000 Code: 200 Max: 300.000000
func (*Results) CalculatePct ¶
CalculatePct calculates percentiles from existing Took values.
Click to show internal directories.
Click to hide internal directories.