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:
Ingo Becker
2022-11-25 17:49:02 +01:00
parent fd142ef5f4
commit 75f6a1d596
2 changed files with 4 additions and 4 deletions

View File

@ -82,8 +82,8 @@ func (c *Container) getPlatformContainerStats(stats *define.ContainerStats, prev
// Handle case where the container is not in a network namespace
if netStats != nil {
stats.NetInput = netStats.TxBytes
stats.NetOutput = netStats.RxBytes
stats.NetInput = netStats.RxBytes
stats.NetOutput = netStats.TxBytes
} else {
stats.NetInput = 0
stats.NetOutput = 0