mirror of
https://github.com/containers/podman.git
synced 2025-06-23 02:18:13 +08:00
stats: map MaxUsage to the correct value
and make sure it is not set for cgroup v2 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -177,7 +177,7 @@ streamLabel: // A label to flatten the scope
|
|||||||
PreCPUStats: preCPUStats,
|
PreCPUStats: preCPUStats,
|
||||||
MemoryStats: docker.MemoryStats{
|
MemoryStats: docker.MemoryStats{
|
||||||
Usage: cgroupStat.MemoryStats.Usage.Usage,
|
Usage: cgroupStat.MemoryStats.Usage.Usage,
|
||||||
MaxUsage: cgroupStat.MemoryStats.Usage.Limit,
|
MaxUsage: cgroupStat.MemoryStats.Usage.MaxUsage,
|
||||||
Stats: nil,
|
Stats: nil,
|
||||||
Failcnt: 0,
|
Failcnt: 0,
|
||||||
Limit: memoryLimit,
|
Limit: memoryLimit,
|
||||||
|
@ -98,6 +98,12 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# max_usage is not set for cgroupv2
|
||||||
|
if have_cgroupsv2; then
|
||||||
|
t GET libpod/containers/stats?containers='[$cid]' 200 \
|
||||||
|
.memory_stats.max_usage=null
|
||||||
|
fi
|
||||||
|
|
||||||
t DELETE libpod/containers/$cid 200 .[0].Id=$cid
|
t DELETE libpod/containers/$cid 200 .[0].Id=$cid
|
||||||
|
|
||||||
# Issue #14676: make sure the stats show the memory limit specified for the container
|
# Issue #14676: make sure the stats show the memory limit specified for the container
|
||||||
|
Reference in New Issue
Block a user