mirror of
https://github.com/containers/podman.git
synced 2025-10-16 18:53:19 +08:00

This mirrors how the Docker API handles things, allowing us to be more compatible with Docker and more verbose on the Libpod API. Stats are given as per network interface in the container, but still aggregated for `podman stats` and `podman pod stats` display (so the CLI does not change, only the Libpod and Compat APIs). Signed-off-by: Matt Heon <mheon@redhat.com>
30 lines
753 B
Bash
30 lines
753 B
Bash
# -*- sh -*-
|
|
#
|
|
# test 'stats' endpoints
|
|
#
|
|
|
|
if root; then
|
|
podman run -dt --name container1 --cpuset-cpus=0 $IMAGE top &>/dev/null
|
|
|
|
# regression for https://github.com/containers/podman/issues/15754
|
|
t GET libpod/containers/container1/stats?stream=false 200 .cpu_stats.online_cpus=1
|
|
fi
|
|
|
|
podman run -dt --name testctr1 $IMAGE top &>/dev/null
|
|
|
|
t GET libpod/containers/testctr1/stats?stream=false 200 '.networks | length'=1
|
|
|
|
podman rm -f testctr1
|
|
|
|
podman network create testnet1
|
|
podman network create testnet2
|
|
|
|
podman run -dt --name testctr2 --net testnet1,testnet2 $IMAGE top &>/dev/null
|
|
|
|
t GET libpod/containers/testctr2/stats?stream=false 200 '.networks | length'=2
|
|
|
|
podman rm -f testctr2
|
|
|
|
podman network rm testnet1
|
|
podman network rm testnet2
|