github.com/opencontainers/runc@v1.2.0-rc.1.0.20240520010911-492dc558cdd6/libcontainer/cgroups/getallpids_test.go (about)

     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  }