mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-02 16:46:35 +00:00
added os_test.go and removed wmi for testing
Signed-off-by: Ben Ridley <benridley29@gmail.com>
This commit is contained in:
23
collector/os_test.go
Normal file
23
collector/os_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package collector
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
func BenchmarkOsCollect(b *testing.B) {
|
||||
o, err := NewOSCollector()
|
||||
if err != nil {
|
||||
b.Error(err)
|
||||
}
|
||||
metrics := make(chan prometheus.Metric)
|
||||
go func() {
|
||||
for {
|
||||
<-metrics
|
||||
}
|
||||
}()
|
||||
for i := 0; i < b.N; i++ {
|
||||
o.Collect(&ScrapeContext{}, metrics)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user