Documentation ¶
Overview ¶
Package latency defines latency utilities.
Index ¶
- type DurationWithLabel
- type DurationWithLabels
- func (ds DurationWithLabels) CSV(path string) error
- func (ds DurationWithLabels) Len() int
- func (ds DurationWithLabels) Less(i, j int) bool
- func (ds DurationWithLabels) PickP50() DurationWithLabel
- func (ds DurationWithLabels) PickP90() DurationWithLabel
- func (ds DurationWithLabels) PickP99() DurationWithLabel
- func (ds DurationWithLabels) PickP999() DurationWithLabel
- func (ds DurationWithLabels) PickP9999() DurationWithLabel
- func (ds DurationWithLabels) Swap(i, j int)
- type Durations
- func (ds Durations) Len() int
- func (ds Durations) Less(i, j int) bool
- func (ds Durations) PickP50() time.Duration
- func (ds Durations) PickP90() time.Duration
- func (ds Durations) PickP99() time.Duration
- func (ds Durations) PickP999() time.Duration
- func (ds Durations) PickP9999() time.Duration
- func (ds Durations) Swap(i, j int)
- type HistogramBucket
- type HistogramBuckets
- type Summary
- type SummaryCompare
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DurationWithLabel ¶
DurationWithLabel is the duration with label. ref. https://en.wikipedia.org/wiki/Kolmogorov%E2%80%93Smirnov_test
type DurationWithLabels ¶
type DurationWithLabels []DurationWithLabel
func LabelDurations ¶
func LabelDurations(ds1 Durations, label string) (ds2 DurationWithLabels)
LabelDurations labels durations.
func (DurationWithLabels) CSV ¶
func (ds DurationWithLabels) CSV(path string) error
func (DurationWithLabels) Len ¶
func (ds DurationWithLabels) Len() int
func (DurationWithLabels) Less ¶
func (ds DurationWithLabels) Less(i, j int) bool
func (DurationWithLabels) PickP50 ¶
func (ds DurationWithLabels) PickP50() DurationWithLabel
PickP50 returns the latency assuming durations are already sorted.
func (DurationWithLabels) PickP90 ¶
func (ds DurationWithLabels) PickP90() DurationWithLabel
PickP90 returns the latency assuming durations are already sorted.
func (DurationWithLabels) PickP99 ¶
func (ds DurationWithLabels) PickP99() DurationWithLabel
PickP99 returns the latency assuming durations are already sorted.
func (DurationWithLabels) PickP999 ¶
func (ds DurationWithLabels) PickP999() DurationWithLabel
PickP999 returns the latency assuming durations are already sorted.
func (DurationWithLabels) PickP9999 ¶
func (ds DurationWithLabels) PickP9999() DurationWithLabel
PickP9999 returns the latency assuming durations are already sorted.
func (DurationWithLabels) Swap ¶
func (ds DurationWithLabels) Swap(i, j int)
type Durations ¶
type HistogramBucket ¶
type HistogramBucket struct { Scale string `json:"scale"` LowerBound float64 `json:"lower-bound"` UpperBound float64 `json:"upper-bound"` Count uint64 `json:"count"` }
HistogramBucket represents metrics latency bucket.
func (HistogramBucket) String ¶
func (bucket HistogramBucket) String() string
type HistogramBuckets ¶
type HistogramBuckets []HistogramBucket
func MergeHistograms ¶
func MergeHistograms(a HistogramBuckets, b HistogramBuckets) (HistogramBuckets, error)
MergeHistograms merges two histograms.
func ParseHistogram ¶
func ParseHistogram(scale string, histo *dto.Histogram) (buckets HistogramBuckets, err error)
ParseHistogram parses Prometheus histogram.
func (HistogramBuckets) Len ¶
func (buckets HistogramBuckets) Len() int
func (HistogramBuckets) Less ¶
func (buckets HistogramBuckets) Less(i, j int) bool
func (HistogramBuckets) Swap ¶
func (buckets HistogramBuckets) Swap(i, j int)
func (HistogramBuckets) Table ¶
func (buckets HistogramBuckets) Table() string
Table converts "HistogramBuckets" to table.
type Summary ¶
type Summary struct { // TestID is the test ID. TestID string `json:"test_id" read-only:"true"` // SuccessTotal is the number of successful client requests. SuccessTotal float64 `json:"success_total" read-only:"true"` // FailureTotal is the number of failed client requests. FailureTotal float64 `json:"failure_total" read-only:"true"` // Histogram is the client requests latency histogram. Histogram HistogramBuckets `json:"histogram" read-only:"true"` // P50 is the 50-percentile latency. P50 time.Duration `json:"p50" read-only:"true"` // P90 is the 90-percentile latency. P90 time.Duration `json:"p90" read-only:"true"` // P99 is the 99-percentile latency. P99 time.Duration `json:"p99" read-only:"true"` // P999 is the 99.9-percentile latency. P999 time.Duration `json:"p99.9" read-only:"true"` // P9999 is the 99.99-percentile latency. P9999 time.Duration `json:"p99.99" read-only:"true"` }
Summary represents request results.
type SummaryCompare ¶
type SummaryCompare struct { A Summary `json:"a" read-only:"true"` B Summary `json:"b" read-only:"true"` P50DeltaPercent float64 `json:"latency-p50-delta-percent" read-only:"true"` P90DeltaPercent float64 `json:"latency-p90-delta-percent" read-only:"true"` P99DeltaPercent float64 `json:"latency-p99-delta-percent" read-only:"true"` P999DeltaPercent float64 `json:"latency-p99.9-delta-percent" read-only:"true"` P9999DeltaPercent float64 `json:"latency-p99.99-delta-percent" read-only:"true"` }
SummaryCompare compares two "Summary". Delta is computed with "A" as "before" and with "B" as "after".
func CompareSummary ¶
func CompareSummary(a Summary, b Summary) (c SummaryCompare, err error)
CompareSummary compares two "Summary".
func (SummaryCompare) JSON ¶
func (c SummaryCompare) JSON() string
func (SummaryCompare) Table ¶
func (c SummaryCompare) Table() string