mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-22 20:56:36 +00:00
chore: enable more linter (#1557)
This commit is contained in:
@@ -1,39 +1,9 @@
|
||||
package perflib
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func ExampleQueryPerformanceData() {
|
||||
objects, err := QueryPerformanceData("2")
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
for _, object := range objects {
|
||||
fmt.Printf("%d %s [%d counters, %d instances]\n",
|
||||
object.NameIndex, object.Name, len(object.CounterDefs), len(object.Instances))
|
||||
|
||||
for _, instance := range object.Instances {
|
||||
if !((instance.Name == "_Total") || (instance.Name == "")) {
|
||||
continue
|
||||
}
|
||||
|
||||
if instance.Name == "" {
|
||||
fmt.Println("No instance.", instance.Name)
|
||||
} else {
|
||||
fmt.Println("Instance:", instance.Name)
|
||||
}
|
||||
|
||||
for _, counter := range instance.Counters {
|
||||
fmt.Printf(" -> %s %d\n", counter.Def.Name, counter.Def.NameIndex)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkQueryPerformanceData(b *testing.B) {
|
||||
for n := 0; n < b.N; n++ {
|
||||
_, _ = QueryPerformanceData("Global")
|
||||
|
||||
Reference in New Issue
Block a user