Documentation ¶
Overview ¶
Package metrics defines metrics utilities.
Index ¶
- type Durations
- func (ds Durations) Len() int
- func (ds Durations) Less(i, j int) bool
- func (ds Durations) PickLantencyP50() time.Duration
- func (ds Durations) PickLantencyP90() time.Duration
- func (ds Durations) PickLantencyP99() time.Duration
- func (ds Durations) PickLantencyP999() time.Duration
- func (ds Durations) PickLantencyP9999() time.Duration
- func (ds Durations) Swap(i, j int)
- type HistogramBucket
- type HistogramBuckets
- type RequestsSummary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Durations ¶ added in v1.2.7
func (Durations) PickLantencyP50 ¶ added in v1.2.7
PickLantencyP50 returns the latency assuming durations are already sorted.
func (Durations) PickLantencyP90 ¶ added in v1.2.7
PickLantencyP90 returns the latency assuming durations are already sorted.
func (Durations) PickLantencyP99 ¶ added in v1.2.7
PickLantencyP99 returns the latency assuming durations are already sorted.
func (Durations) PickLantencyP999 ¶ added in v1.2.7
PickLantencyP999 returns the latency assuming durations are already sorted.
func (Durations) PickLantencyP9999 ¶ added in v1.2.7
PickLantencyP9999 returns the latency assuming durations are already sorted.
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 ¶ added in v1.2.0
func (buckets HistogramBuckets) Table() string
Table converts "HistogramBuckets" to table.
type RequestsSummary ¶ added in v1.2.2
type RequestsSummary struct { // 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"` // LatencyHistogram is the client requests latency histogram. LatencyHistogram HistogramBuckets `json:"latency-histogram" read-only:"true"` // LantencyP50 is the 50-percentile latency. LantencyP50 time.Duration `json:"latency-p50" read-only:"true"` // LantencyP90 is the 90-percentile latency. LantencyP90 time.Duration `json:"latency-p90" read-only:"true"` // LantencyP99 is the 99-percentile latency. LantencyP99 time.Duration `json:"latency-p99" read-only:"true"` // LantencyP999 is the 99.9-percentile latency. LantencyP999 time.Duration `json:"latency-p99.9" read-only:"true"` // LantencyP9999 is the 99.99-percentile latency. LantencyP9999 time.Duration `json:"latency-p99.99" read-only:"true"` }
RequestsSummary represents request results.
func (RequestsSummary) JSON ¶ added in v1.2.2
func (rs RequestsSummary) JSON() string
func (RequestsSummary) Table ¶ added in v1.2.2
func (rs RequestsSummary) Table() string