Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MetricsTestCase ¶
type MetricsTestCase struct { // Target is the Prometheus Collector implementation to test Target prometheus.Collector // Want is the expected output in the metric API response as the result of Target Collector Want string // Metrics is the names of the metrics to test; leave empty to test all metrics. Metrics []string }
MetricsTestCase can be used to unit test a Prometheus Collector implementation. It takes a initialized Prometheus Collector and check if the metric it defines is standard and produces the expected output.
type MetricsTestCases ¶
type MetricsTestCases map[string]MetricsTestCase
MetricsTestCases is a alias for a set of MetricsTestCase. It provide a convenient and standard way to unit test multiple MetricsTestCase. The keys of the map are the names of the test cases.
func (MetricsTestCases) Test ¶
func (mtc MetricsTestCases) Test(t *testing.T)
Test runs all given test cases under the given testing.T object.
Click to show internal directories.
Click to hide internal directories.