promhelp
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package promhelp provides helper functions for asserting Prometheusmetric values in unit tests.
Index¶
- func Compare(reg prometheus.Gatherer, compare string, metricNames ...string) error
- func CounterValue(t testing.TB, reg prometheus.Gatherer, metricName string, ...) int
- func GaugeValue(t testing.TB, reg prometheus.Gatherer, metricName string, ...) int
- func HistogramValue(t testing.TB, reg prometheus.Gatherer, metricName string, ...) *io_prometheus_client.Histogram
- func MetricValue(t testing.TB, reg prometheus.Gatherer, metricName string, ...) *io_prometheus_client.Metric
- func RegistryDump(reg *prometheus.Registry) string
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcCompare¶
func Compare(regprometheus.Gatherer, comparestring, metricNames ...string)error
Compare can be used to compare a registry to some prometheus formattedtext. If any values differ, an error is returned.If metric names are passed in, only those metrics will be compared.Usage: `Compare(reg, RegistryDump(reg))`
funcCounterValue¶
func CounterValue(ttesting.TB, regprometheus.Gatherer, metricNamestring, labelsprometheus.Labels)int
CounterValue returns the value of a counter metric with the given name and labels.
funcGaugeValue¶
func GaugeValue(ttesting.TB, regprometheus.Gatherer, metricNamestring, labelsprometheus.Labels)int
GaugeValue returns the value of a gauge metric with the given name and labels.
funcHistogramValue¶
func HistogramValue(ttesting.TB, regprometheus.Gatherer, metricNamestring, labelsprometheus.Labels) *io_prometheus_client.Histogram
HistogramValue returns the value of a histogram metric with the given name and labels.
funcMetricValue¶
func MetricValue(ttesting.TB, regprometheus.Gatherer, metricNamestring, labelsprometheus.Labels) *io_prometheus_client.Metric
funcRegistryDump¶
func RegistryDump(reg *prometheus.Registry)string
RegistryDump returns the http page for a given registry's metrics.Very useful for visual debugging.
Types¶
This section is empty.