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.
Click to show internal directories.
Click to hide internal directories.