metrics

package
v1.19.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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