Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientType ¶
type ClientType int
ClientType is the type of HTTP client used in test
const ( // FastHTTP is fasthttp's HTTP client FastHTTP ClientType = iota // NetHTTP1 is Go's default HTTP client with forced HTTP/1.x NetHTTP1 // NetHTTP2 is Go's default HTTP client with HTTP/2.0 permitted. NetHTTP2 )
type ErrorWithCount ¶
ErrorWithCount contains error description alongside with number of times this error occurred.
type LatenciesStats ¶
type LatenciesStats struct { // These are in microseconds Mean float64 Stddev float64 Max float64 // This is map[0.0 <= p <= 1.0 (percentile)]microseconds Percentiles map[float64]uint64 }
LatenciesStats contains statistical information about latencies.
type ReadonlyFloat64Histogram ¶
type ReadonlyFloat64Histogram interface { Get(float64) uint64 VisitAll(func(float64, uint64) bool) Count() uint64 }
ReadonlyFloat64Histogram is a readonly histogram with float64 keys
type ReadonlyUint64Histogram ¶
type ReadonlyUint64Histogram interface { Get(uint64) uint64 VisitAll(func(uint64, uint64) bool) Count() uint64 }
ReadonlyUint64Histogram is a readonly histogram with uint64 keys
type RequestsStats ¶
type RequestsStats struct { // These are in requests per second. Mean float64 Stddev float64 Max float64 // This is map[0.0 <= p <= 1.0 (percentile)](req-s per second) Percentiles map[float64]float64 }
RequestsStats contains statistical information about requests.
type Results ¶
type Results struct {
BytesRead, BytesWritten int64
TimeTaken time.Duration
Req1XX, Req2XX, Req3XX, Req4XX, Req5XX uint64
Others uint64
Errors []ErrorWithCount
Latencies ReadonlyUint64Histogram
Requests ReadonlyFloat64Histogram
}
Results holds results of the test.
func (Results) LatenciesStats ¶
func (r Results) LatenciesStats(percentiles []float64) *LatenciesStats
LatenciesStats performs various statistical calculations on latencies.
func (Results) RequestsStats ¶
func (r Results) RequestsStats(percentiles []float64) *RequestsStats
RequestsStats performs various statistical calculations on latencies.
func (Results) Throughput ¶
Throughput returns total throughput (read + write) in bytes per second
type Spec ¶
type Spec struct { NumberOfConnections uint64 TestType TestType NumberOfRequests uint64 TestDuration time.Duration Method string URL string Headers []Header Body string BodyFilePath string CertPath string KeyPath string Stream bool Timeout time.Duration ClientType ClientType Rate *uint64 }
Spec contains information about test performed.
func (Spec) IsFastHTTP ¶
IsFastHTTP tells whether fasthttp were used as HTTP client to perform the test.
func (Spec) IsNetHTTPV1 ¶
IsNetHTTPV1 tells whether Go's default net/http library and HTTP/1.x were used to perform the test.
func (Spec) IsNetHTTPV2 ¶
IsNetHTTPV2 tells whether Go's default net/http library and HTTP/1.x (or HTTP/2.0, if possible) were used to perform the test.
func (Spec) IsTestWithNumberOfReqs ¶
IsTestWithNumberOfReqs tells if the test was limited by the number of requests.
func (Spec) IsTimedTest ¶
IsTimedTest tells if the test was limited by time.