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

Function TestCgroupv2PSIStats

cgroup2/manager_test.go:371–387  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

369}
370
371func TestCgroupv2PSIStats(t *testing.T) {
372 checkCgroupMode(t)
373 group := "/psi-test-cg"
374 groupPath := fmt.Sprintf("%s-%d", group, os.Getpid())
375 res := Resources{}
376 c, err := NewManager(defaultCgroup2Path, groupPath, &res)
377 require.NoError(t, err, "failed to init new cgroup manager")
378 t.Cleanup(func() {
379 os.Remove(c.path)
380 })
381
382 stats, err := c.Stat()
383 require.NoError(t, err, "failed to get cgroup stats")
384 if stats.CPU.PSI == nil || stats.Memory.PSI == nil || stats.Io.PSI == nil {
385 t.Error("expected psi not nil but got nil")
386 }
387}
388
389func TestSystemdCgroupPSIController(t *testing.T) {
390 checkCgroupMode(t)

Callers

nothing calls this directly

Calls 3

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…