mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-25 06:06:35 +00:00
chore: release 0.29.0.rc0 (#1600)
This commit is contained in:
49
pkg/perfdata/collector_bench_test.go
Normal file
49
pkg/perfdata/collector_bench_test.go
Normal file
@@ -0,0 +1,49 @@
|
||||
package perfdata_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prometheus-community/windows_exporter/pkg/perfdata"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func BenchmarkTestCollector(b *testing.B) {
|
||||
counters := []string{
|
||||
"% Processor Time",
|
||||
"% Privileged Time",
|
||||
"% User Time",
|
||||
"Creating Process ID",
|
||||
"Elapsed Time",
|
||||
"Handle Count",
|
||||
"ID Process",
|
||||
"IO Data Bytes/sec",
|
||||
"IO Data Operations/sec",
|
||||
"IO Other Bytes/sec",
|
||||
"IO Other Operations/sec",
|
||||
"IO Read Bytes/sec",
|
||||
"IO Read Operations/sec",
|
||||
"IO Write Bytes/sec",
|
||||
"IO Write Operations/sec",
|
||||
"Page Faults/sec",
|
||||
"Page File Bytes Peak",
|
||||
"Page File Bytes",
|
||||
"Pool Nonpaged Bytes",
|
||||
"Pool Paged Bytes",
|
||||
"Priority Base",
|
||||
"Private Bytes",
|
||||
"Thread Count",
|
||||
"Virtual Bytes Peak",
|
||||
"Virtual Bytes",
|
||||
"Working Set - Private",
|
||||
"Working Set Peak",
|
||||
"Working Set",
|
||||
}
|
||||
performanceData, err := perfdata.NewCollector("Process", []string{"*"}, counters)
|
||||
require.NoError(b, err)
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
_, _ = performanceData.Collect()
|
||||
}
|
||||
|
||||
performanceData.Close()
|
||||
}
|
||||
Reference in New Issue
Block a user