metrics

package
v1.18.5 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metric

type Metric struct {
	Value float64
	Name  string
}

type Metrics

type Metrics struct {
	// contains filtered or unexported fields
}

func New

func New(t assert.TestingT, ctx context.Context, httpclient *http.Client, url string) *Metrics

func (*Metrics) All

func (m *Metrics) All() map[string]float64

func (*Metrics) MatchMetric

func (m *Metrics) MatchMetric(substrings ...string) []Metric

func (*Metrics) MatchMetricAndSum

func (m *Metrics) MatchMetricAndSum(t assert.TestingT, sum float64, substrings ...string) bool

MatchMetricAndSum returns true if the set of metrics has a specific sum

func (*Metrics) SumWithLabels added in v1.18.4

func (m *Metrics) SumWithLabels(name string, labelPairs ...string) float64

MatchMetric returns all metrics that contain all the substrings in the key This is useful because of the way we serialize labels in the metrics name SumWithLabels sums every series of the exactly-named metric whose labels include each of the given name:value pairs. Unlike the substring matchers below, histogram expansions of other metrics sharing a name prefix (_bucket/_sum/_count) are never matched.

type MetricsWithLabels added in v1.16.0

type MetricsWithLabels struct {
	Metrics map[string]map[string]float64
}

func NewWithLabels added in v1.16.0

func NewWithLabels(t *testing.T, ctx context.Context, httpclient *http.Client, url string) *MetricsWithLabels

Jump to

Keyboard shortcuts

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