Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions integration/client/container_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func TestTaskUpdate(t *testing.T) {
if err != nil {
t.Fatal(err)
}
stat, err := cgroup2.Stat()
stat, err := cgroup2.StatFiltered(cgroupsv2.StatMemory)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -144,7 +144,7 @@ func TestTaskUpdate(t *testing.T) {
}
// check that the task has a limit of 64mb
if cgroups.Mode() == cgroups.Unified {
stat, err := cgroup2.Stat()
stat, err := cgroup2.StatFiltered(cgroupsv2.StatMemory)
if err != nil {
t.Fatal(err)
}
Expand Down
4 changes: 2 additions & 2 deletions integration/container_update_resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func getCgroupSwapLimitForTask(t *testing.T, task containerd.Task) uint64 {
if err != nil {
t.Fatal(err)
}
stat, err := cgroup2.Stat()
stat, err := cgroup2.StatFiltered(cgroupsv2.StatMemory)
if err != nil {
t.Fatal(err)
}
Expand All @@ -105,7 +105,7 @@ func getCgroupMemoryLimitForTask(t *testing.T, task containerd.Task) uint64 {
if err != nil {
t.Fatal(err)
}
stat, err := cgroup2.Stat()
stat, err := cgroup2.StatFiltered(cgroupsv2.StatMemory)
if err != nil {
t.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/cri/server/sandbox_stats_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func cgroupMetricsForSandbox(sandbox sandboxstore.Sandbox) (*cgroupMetrics, erro
if err != nil {
return nil, fmt.Errorf("failed to load sandbox cgroup: %v: %w", cgroupPath, err)
}
stats, err := cg.Stat()
stats, err := cg.StatFiltered(cgroupsv2.StatCPU | cgroupsv2.StatMemory)
if err != nil {
return nil, fmt.Errorf("failed to get stats for cgroup: %v: %w", cgroupPath, err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/cri/server/stats_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func (c *StatsCollector) getCgroupCPUUsage(ctx context.Context, cgroupPath strin
log.G(ctx).WithError(err).Debugf("StatsCollector: failed to load cgroupv2: %s", cgroupPath)
return 0, false
}
stats, err := cg.Stat()
stats, err := cg.StatFiltered(cgroupsv2.StatCPU)
if err != nil {
log.G(ctx).WithError(err).Debugf("StatsCollector: failed to get cgroupv2 stats: %s", cgroupPath)
return 0, false
Expand Down
Loading