Documentation
¶
Index ¶
- func Collect(c collector.Collector, ch chan<- prometheus.Metric, ...) (err error)
- func FuncBenchmarkCollector[C collector.Collector](b *testing.B, name string, collectFunc collector.BuilderWithFlags[C], ...)
- func GetProcessHandleCount(handle windows.Handle) (uint32, error)
- func MetricValuesByLabel(families map[string]*dto.MetricFamily, metricName, labelName string) map[string]float64
- func RequireFixtureMetric(t *testing.T, families map[string]*dto.MetricFamily, ...) *dto.Metric
- func TestCollector[C collector.Collector, V any](t *testing.T, fn func(*V) C, conf *V) map[string]*dto.MetricFamily
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Collect ¶ added in v0.32.0
func Collect(c collector.Collector, ch chan<- prometheus.Metric, maxScrapeDuration time.Duration) (err error)
Collect calls c.Collect within a scrape of the caches of c, as the collection does. Calling c.Collect directly collects without the caches.
func FuncBenchmarkCollector ¶
func FuncBenchmarkCollector[C collector.Collector](b *testing.B, name string, collectFunc collector.BuilderWithFlags[C], fn ...func(app *kingpin.Application))
func GetProcessHandleCount ¶ added in v0.31.3
func MetricValuesByLabel ¶ added in v0.32.0
func MetricValuesByLabel(families map[string]*dto.MetricFamily, metricName, labelName string) map[string]float64
MetricValuesByLabel returns the gauge or counter values of metricName, keyed by the value of the label labelName.
func RequireFixtureMetric ¶ added in v0.32.0
func RequireFixtureMetric(t *testing.T, families map[string]*dto.MetricFamily, collectorName, metricName string, labels prometheus.Labels) *dto.Metric
RequireFixtureMetric checks a known CI fixture without requiring it on a developer's machine. Labels match exactly, ignoring case for Windows names.
func TestCollector ¶
func TestCollector[C collector.Collector, V any](t *testing.T, fn func(*V) C, conf *V) map[string]*dto.MetricFamily
TestCollector validates real Windows collector output. CI lists provisioned collectors in WINDOWS_EXPORTER_TEST_COLLECTORS so setup failures cannot skip.
Types ¶
This section is empty.