1 package cgroups 2 3 import ( 4 "testing" 5 ) 6 7 func BenchmarkGetAllPids(b *testing.B) { 8 total := 0 9 for i := 0; i < b.N; i++ { 10 i, err := GetAllPids("/sys/fs/cgroup") 11 if err != nil { 12 b.Fatal(err) 13 } 14 total += len(i) 15 } 16 b.Logf("iter: %d, total: %d", b.N, total) 17 } 18