MCPcopy Create free account
hub / github.com/containerd/cgroups / BenchmarkStat

Function BenchmarkStat

cgroup2/manager_test.go:449–464  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

447}
448
449func BenchmarkStat(b *testing.B) {
450 checkCgroupMode(b)
451 group := "/stat-test-cg"
452 groupPath := fmt.Sprintf("%s-%d", group, os.Getpid())
453 c, err := NewManager(defaultCgroup2Path, groupPath, &Resources{})
454 require.NoErrorf(b, err, "failed to init new cgroup manager")
455 b.Cleanup(func() {
456 _ = c.Delete()
457 })
458
459 b.ReportAllocs()
460 for i := 0; i < b.N; i++ {
461 _, err := c.Stat()
462 require.NoError(b, err)
463 }
464}
465
466func TestStatFiltered(t *testing.T) {
467 checkCgroupMode(t)

Callers

nothing calls this directly

Calls 4

DeleteMethod · 0.95
StatMethod · 0.95
checkCgroupModeFunction · 0.85
NewManagerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…