metrics

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package metrics defines metrics utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Durations added in v1.2.7

type Durations []time.Duration

func (Durations) Len added in v1.2.7

func (ds Durations) Len() int

func (Durations) Less added in v1.2.7

func (ds Durations) Less(i, j int) bool

func (Durations) PickLantencyP50 added in v1.2.7

func (ds Durations) PickLantencyP50() time.Duration

PickLantencyP50 returns the latency assuming durations are already sorted.

func (Durations) PickLantencyP90 added in v1.2.7

func (ds Durations) PickLantencyP90() time.Duration

PickLantencyP90 returns the latency assuming durations are already sorted.

func (Durations) PickLantencyP99 added in v1.2.7

func (ds Durations) PickLantencyP99() time.Duration

PickLantencyP99 returns the latency assuming durations are already sorted.

func (Durations) PickLantencyP999 added in v1.2.7

func (ds Durations) PickLantencyP999() time.Duration

PickLantencyP999 returns the latency assuming durations are already sorted.

func (Durations) PickLantencyP9999 added in v1.2.7

func (ds Durations) PickLantencyP9999() time.Duration

PickLantencyP9999 returns the latency assuming durations are already sorted.

func (Durations) Swap added in v1.2.7

func (ds Durations) Swap(i, j int)

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL