metrics

package
Version: v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: Apache-2.0 Imports: 14 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 DurationWithLabel added in v1.4.6

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 added in v1.4.6

type DurationWithLabels []DurationWithLabel

func LabelDurations added in v1.4.6

func LabelDurations(ds1 Durations, label string) (ds2 DurationWithLabels)

LabelDurations labels durations.

func (DurationWithLabels) CSV added in v1.4.6

func (ds DurationWithLabels) CSV(path string) error

func (DurationWithLabels) Len added in v1.4.6

func (ds DurationWithLabels) Len() int

func (DurationWithLabels) Less added in v1.4.6

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

func (DurationWithLabels) PickLantencyP50 added in v1.4.6

func (ds DurationWithLabels) PickLantencyP50() DurationWithLabel

PickLantencyP50 returns the latency assuming durations are already sorted.

func (DurationWithLabels) PickLantencyP90 added in v1.4.6

func (ds DurationWithLabels) PickLantencyP90() DurationWithLabel

PickLantencyP90 returns the latency assuming durations are already sorted.

func (DurationWithLabels) PickLantencyP99 added in v1.4.6

func (ds DurationWithLabels) PickLantencyP99() DurationWithLabel

PickLantencyP99 returns the latency assuming durations are already sorted.

func (DurationWithLabels) PickLantencyP999 added in v1.4.6

func (ds DurationWithLabels) PickLantencyP999() DurationWithLabel

PickLantencyP999 returns the latency assuming durations are already sorted.

func (DurationWithLabels) PickLantencyP9999 added in v1.4.6

func (ds DurationWithLabels) PickLantencyP9999() DurationWithLabel

PickLantencyP9999 returns the latency assuming durations are already sorted.

func (DurationWithLabels) Swap added in v1.4.6

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

type Durations added in v1.2.7

type Durations []time.Duration

func DownloadDurationsFromS3 added in v1.4.6

func DownloadDurationsFromS3(lg *zap.Logger, s3API s3iface.S3API, bucketName string, s3Key string) (rs Durations, err error)

DownloaDurationsRFromS3 downloads the file from S3 bucket, and parses "Durations".

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 RequestsCompare added in v1.4.6

type RequestsCompare struct {
	A RequestsSummary `json:"a" read-only:"true"`
	B RequestsSummary `json:"b" read-only:"true"`

	LantencyP50DeltaPercent   float64 `json:"latency-p50-delta-percent" read-only:"true"`
	LantencyP90DeltaPercent   float64 `json:"latency-p90-delta-percent" read-only:"true"`
	LantencyP99DeltaPercent   float64 `json:"latency-p99-delta-percent" read-only:"true"`
	LantencyP999DeltaPercent  float64 `json:"latency-p99.9-delta-percent" read-only:"true"`
	LantencyP9999DeltaPercent float64 `json:"latency-p99.99-delta-percent" read-only:"true"`
}

RequestsCompare compares two "RequestsSummary". Delta is computed with "A" as "before" and with "B" as "after".

func CompareRequestsSummary added in v1.4.6

func CompareRequestsSummary(a RequestsSummary, b RequestsSummary) (c RequestsCompare, err error)

CompareRequestsSummary compares two "RequestsSummary".

func (RequestsCompare) JSON added in v1.4.6

func (c RequestsCompare) JSON() string

func (RequestsCompare) Table added in v1.4.6

func (c RequestsCompare) Table() string

type RequestsSummary added in v1.2.2

type RequestsSummary 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"`
	// 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 DownloadRequestsSummaryFromS3 added in v1.4.6

func DownloadRequestsSummaryFromS3(lg *zap.Logger, s3API s3iface.S3API, bucketName string, s3Key string) (rs RequestsSummary, err error)

DownloadRequestsSummaryFromS3 downloads the file from S3 bucket, and parses "RequestsSummary".

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

Source Files

Jump to

Keyboard shortcuts

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