mirror of
https://github.com/prometheus-community/windows_exporter
synced 2025-01-10 00:09:33 +00:00
e6a15d4ec4
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
23 lines
680 B
Go
23 lines
680 B
Go
//go:build windows
|
|
|
|
package printer_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/alecthomas/kingpin/v2"
|
|
"github.com/prometheus-community/windows_exporter/internal/collector/printer"
|
|
"github.com/prometheus-community/windows_exporter/internal/utils/testutils"
|
|
)
|
|
|
|
func BenchmarkCollector(b *testing.B) {
|
|
// Whitelist is not set in testing context (kingpin flags not parsed), causing the collector to skip all printers.
|
|
printersInclude := ".+"
|
|
kingpin.CommandLine.GetArg("collector.printer.include").StringVar(&printersInclude)
|
|
testutils.FuncBenchmarkCollector(b, "printer", printer.NewWithFlags)
|
|
}
|
|
|
|
func TestCollector(t *testing.T) {
|
|
testutils.TestCollector(t, printer.New, nil)
|
|
}
|