Refactor collectors

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke
2023-11-04 20:51:35 +01:00
parent 569f5450cd
commit 0711268d3c
207 changed files with 15220 additions and 13648 deletions

View File

@@ -0,0 +1,19 @@
//go:build windows
package net_test
import (
"testing"
"github.com/alecthomas/kingpin/v2"
"github.com/prometheus-community/windows_exporter/pkg/collector/net"
"github.com/prometheus-community/windows_exporter/pkg/testutils"
)
func BenchmarkCollector(b *testing.B) {
// Include is not set in testing context (kingpin flags not parsed), causing the collector to skip all interfaces.
localNicInclude := ".+"
kingpin.CommandLine.GetArg(net.FlagNicInclude).StringVar(&localNicInclude)
testutils.FuncBenchmarkCollector(b, net.Name, net.NewWithFlags)
}