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

Function TestSystemdCgroupPSIController

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

Source from the content-addressed store, hash-verified

387}
388
389func TestSystemdCgroupPSIController(t *testing.T) {
390 checkCgroupMode(t)
391 group := fmt.Sprintf("testing-psi-%d.scope", os.Getpid())
392 pid := os.Getpid()
393 res := Resources{}
394 c, err := NewSystemd("", group, pid, &res)
395 require.NoError(t, err, "failed to init new cgroup systemd manager")
396
397 stats, err := c.Stat()
398 require.NoError(t, err, "failed to get cgroup stats")
399 if stats.CPU.PSI == nil || stats.Memory.PSI == nil || stats.Io.PSI == nil {
400 t.Error("expected psi not nil but got nil")
401 }
402}
403
404func TestCPUQuotaPeriodUSec(t *testing.T) {
405 checkCgroupMode(t)

Callers

nothing calls this directly

Calls 3

checkCgroupModeFunction · 0.85
NewSystemdFunction · 0.70
StatMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…