mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-08 05:56:37 +00:00
19
pkg/collector/net/net_bench_test.go
Normal file
19
pkg/collector/net/net_bench_test.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user