Add Printer Exporter (#1485)

This commit is contained in:
Soheil Rahmat
2024-05-17 18:47:32 +02:00
committed by GitHub
parent 9e24ce8f74
commit f85866ce1e
8 changed files with 277 additions and 2 deletions

View File

@@ -0,0 +1,17 @@
package printer_test
import (
"testing"
"github.com/alecthomas/kingpin/v2"
"github.com/prometheus-community/windows_exporter/pkg/collector/printer"
"github.com/prometheus-community/windows_exporter/pkg/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(printer.FlagPrinterInclude).StringVar(&printersInclude)
testutils.FuncBenchmarkCollector(b, "printer", printer.NewWithFlags)
}