Documentation ¶
Overview ¶
Package stats provides types and functions to handle statistics of executed requests incl. timing, errors and content
Index ¶
- type FinishedRequests
- func (f FinishedRequests) AverageTotalTime() time.Duration
- func (f FinishedRequests) BytesPerSecond() float32
- func (f FinishedRequests) Finished() time.Time
- func (f FinishedRequests) Len() int
- func (f FinishedRequests) Less(i, j int) bool
- func (f FinishedRequests) MaxTotalTime() time.Duration
- func (f FinishedRequests) MedianTotalTime() time.Duration
- func (f FinishedRequests) MinTotalTime() time.Duration
- func (f FinishedRequests) NumberOfErrors() (errors int)
- func (f FinishedRequests) NumberOfKeepAliveRequests() (count int)
- func (f FinishedRequests) NumberOfRequests() int
- func (f FinishedRequests) RequestsPerSecond() float32
- func (f FinishedRequests) Started() time.Time
- func (f FinishedRequests) Swap(i, j int)
- func (f FinishedRequests) TotalBytes() int64
- func (f FinishedRequests) TotalDuration() time.Duration
- func (f FinishedRequests) TotalTime() time.Duration
- func (f FinishedRequests) TotalTimePercentile(percentile float32) time.Duration
- type Series
- type Stats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FinishedRequests ¶
type FinishedRequests []*request.FinishedRequest
FinishedRequests represents a list of finished requests Implements sort.Interface which allows finished requests to be sorted by total time
func (FinishedRequests) AverageTotalTime ¶
func (f FinishedRequests) AverageTotalTime() time.Duration
AverageTotalTime returns the average total time
func (FinishedRequests) BytesPerSecond ¶
func (f FinishedRequests) BytesPerSecond() float32
BytesPerSecond returns the number of requests per second
func (FinishedRequests) Finished ¶
func (f FinishedRequests) Finished() time.Time
Finished returns the last finished time of all samples
func (FinishedRequests) Len ¶
func (f FinishedRequests) Len() int
Returns the number of samples Needed by sort.Interface
func (FinishedRequests) Less ¶
func (f FinishedRequests) Less(i, j int) bool
Compares two elements Needed by sort.Interface
func (FinishedRequests) MaxTotalTime ¶
func (f FinishedRequests) MaxTotalTime() time.Duration
MaxTotalTime returns the maximum total time
func (FinishedRequests) MedianTotalTime ¶
func (f FinishedRequests) MedianTotalTime() time.Duration
MedianTotalTime returns the median total which is the 50% percentile
func (FinishedRequests) MinTotalTime ¶
func (f FinishedRequests) MinTotalTime() time.Duration
MinTotalTime returns the minimum total time.
func (FinishedRequests) NumberOfErrors ¶
func (f FinishedRequests) NumberOfErrors() (errors int)
NumberOfErrors returns the number of samples marked as errornous
func (FinishedRequests) NumberOfKeepAliveRequests ¶
func (f FinishedRequests) NumberOfKeepAliveRequests() (count int)
NumberOfKeepAliveRequests returns the number of requests that reused an existing TCP connection
func (FinishedRequests) NumberOfRequests ¶
func (f FinishedRequests) NumberOfRequests() int
NumberOfRequests returns the number of samples.
func (FinishedRequests) RequestsPerSecond ¶
func (f FinishedRequests) RequestsPerSecond() float32
RequestsPerSecond returns the number of requests per second
func (FinishedRequests) Started ¶
func (f FinishedRequests) Started() time.Time
Started returns the first start time of all samples
func (FinishedRequests) Swap ¶
func (f FinishedRequests) Swap(i, j int)
Swaps two elements Needed by sort.Interface
func (FinishedRequests) TotalBytes ¶
func (f FinishedRequests) TotalBytes() int64
TotalBytes returns the total bytes received for the samples
func (FinishedRequests) TotalDuration ¶
func (f FinishedRequests) TotalDuration() time.Duration
TotalDuration returns the overall duration of all samples
func (FinishedRequests) TotalTime ¶
func (f FinishedRequests) TotalTime() time.Duration
TotalTime returns the total time
func (FinishedRequests) TotalTimePercentile ¶
func (f FinishedRequests) TotalTimePercentile(percentile float32) time.Duration
TotalTimePercentile returns the given total time percentile percentile must be between 0 and 1.0
type Series ¶
type Series struct { Label string FinishedRequests []*request.FinishedRequest }
Series represents a (potentially growing) set of samples Series provides operations for obtaining Stats from the samples using different groupings.
func (*Series) AddRequest ¶
func (s *Series) AddRequest(req *request.FinishedRequest) *Series
AddRequest adds a single sample to the series It returns the series for invocation chaining
func (*Series) Stats ¶
Stats "freezes" the current samples of this series and returns a Stats instance for those samples. The series may be used to collect more samples.
func (*Series) StatsByURL ¶
StatsByURL groups all samples of the series by their URL and returns stats for each URL.
type Stats ¶
type Stats struct { // A Label (URL most of the time) for these stats Label string // The requests FinishedRequests }
Stats represents a labeled set of samples
func (*Stats) FirstNonErrorRequest ¶
func (s *Stats) FirstNonErrorRequest() *request.FinishedRequest
FirstNonErrorRequest returns the first finished request that was successful or nil