testutils

package
v0.32.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 21 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Rendered for windows/amd64

Index

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 GetProcessHandleCount(handle windows.Handle) (uint32, error)

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.

Jump to

Keyboard shortcuts

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