mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-09 14:36:38 +00:00
24 lines
352 B
Go
24 lines
352 B
Go
package collector
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
)
|
|
|
|
func BenchmarkCsCollect(b *testing.B) {
|
|
c, err := NewCSCollector()
|
|
if err != nil {
|
|
b.Error(err)
|
|
}
|
|
metrics := make(chan prometheus.Metric)
|
|
go func() {
|
|
for {
|
|
<-metrics
|
|
}
|
|
}()
|
|
for i := 0; i < b.N; i++ {
|
|
c.Collect(&ScrapeContext{}, metrics)
|
|
}
|
|
}
|