promtest

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package promtest provides test utilites for testing Prometheus metrics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PrometheusMetricTest

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

PrometheusMetricTest stores information about a metric to use for testing.

func NewPrometheusMetricTest

func NewPrometheusMetricTest(tb testing.TB, name string, metric prometheus.Collector, labels prometheus.Labels) *PrometheusMetricTest

NewPrometheusMetricTest creates a new test object for a Prometheus metric. It stores the current value of the metric along with the metric name.

func (*PrometheusMetricTest) CheckDelta

func (p *PrometheusMetricTest) CheckDelta(delta float64)

CheckDelta checks that the metric value changes exactly delta from when Helper was called.

func (*PrometheusMetricTest) CheckExists

func (p *PrometheusMetricTest) CheckExists()

CheckExists confirms that the metric exists and returns the count of metrics.

Jump to

Keyboard shortcuts

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