File: getallpids_test.go

package info (click to toggle)
golang-github-opencontainers-cgroups 0.0.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 872 kB
  • sloc: makefile: 2
file content (17 lines) | stat: -rw-r--r-- 266 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package cgroups

import (
	"testing"
)

func BenchmarkGetAllPids(b *testing.B) {
	total := 0
	for i := 0; i < b.N; i++ {
		i, err := GetAllPids("/sys/fs/cgroup")
		if err != nil {
			b.Fatal(err)
		}
		total += len(i)
	}
	b.Logf("iter: %d, total: %d", b.N, total)
}