(b *testing.B)
| 447 | } |
| 448 | |
| 449 | func 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 | |
| 466 | func TestStatFiltered(t *testing.T) { |
| 467 | checkCgroupMode(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…