mirror of
https://github.com/containers/podman.git
synced 2025-07-03 09:17:15 +08:00
Fix swapped NetInput/-Output stats
Fix swapped NetInput and NetOutput container stats. This resulted in `podman stats` showing outgoing traffic as NetInput and incoming traffic as NetOutput. This change might be visible or cause problems for users who are actively relying on those stats for monitoring reasons. [NO NEW TEST NEEDED] Signed-off-by: Ingo Becker <ingo@orgizm.net>
This commit is contained in:
@ -82,8 +82,8 @@ func (c *Container) getPlatformContainerStats(stats *define.ContainerStats, prev
|
|||||||
|
|
||||||
// Handle case where the container is not in a network namespace
|
// Handle case where the container is not in a network namespace
|
||||||
if netStats != nil {
|
if netStats != nil {
|
||||||
stats.NetInput = netStats.TxBytes
|
stats.NetInput = netStats.RxBytes
|
||||||
stats.NetOutput = netStats.RxBytes
|
stats.NetOutput = netStats.TxBytes
|
||||||
} else {
|
} else {
|
||||||
stats.NetInput = 0
|
stats.NetInput = 0
|
||||||
stats.NetOutput = 0
|
stats.NetOutput = 0
|
||||||
|
@ -72,8 +72,8 @@ func (c *Container) getPlatformContainerStats(stats *define.ContainerStats, prev
|
|||||||
stats.PerCPU = cgroupStats.CpuStats.CpuUsage.PercpuUsage
|
stats.PerCPU = cgroupStats.CpuStats.CpuUsage.PercpuUsage
|
||||||
// Handle case where the container is not in a network namespace
|
// Handle case where the container is not in a network namespace
|
||||||
if netStats != nil {
|
if netStats != nil {
|
||||||
stats.NetInput = netStats.TxBytes
|
stats.NetInput = netStats.RxBytes
|
||||||
stats.NetOutput = netStats.RxBytes
|
stats.NetOutput = netStats.TxBytes
|
||||||
} else {
|
} else {
|
||||||
stats.NetInput = 0
|
stats.NetInput = 0
|
||||||
stats.NetOutput = 0
|
stats.NetOutput = 0
|
||||||
|
Reference in New Issue
Block a user