latency

package
v0.0.0-...-6d46272 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 11 Imported by: 4

Documentation

Overview

Package latency defines latency utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DurationWithLabel

type DurationWithLabel struct {
	time.Duration
	Label string
}

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

PickP50 returns the latency assuming durations are already sorted.

func (DurationWithLabels) PickP90

PickP90 returns the latency assuming durations are already sorted.

func (DurationWithLabels) PickP99

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 Durations []time.Duration

func (Durations) Len

func (ds Durations) Len() int

func (Durations) Less

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

func (Durations) PickP50

func (ds Durations) PickP50() time.Duration

PickP50 returns the latency assuming durations are already sorted.

func (Durations) PickP90

func (ds Durations) PickP90() time.Duration

PickP90 returns the latency assuming durations are already sorted.

func (Durations) PickP99

func (ds Durations) PickP99() time.Duration

PickP99 returns the latency assuming durations are already sorted.

func (Durations) PickP999

func (ds Durations) PickP999() time.Duration

PickP999 returns the latency assuming durations are already sorted.

func (Durations) PickP9999

func (ds Durations) PickP9999() time.Duration

PickP9999 returns the latency assuming durations are already sorted.

func (Durations) Swap

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

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.

func (Summary) JSON

func (rs Summary) JSON() string

func (Summary) Table

func (rs Summary) Table() string

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

Jump to

Keyboard shortcuts

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