NAME¶ 名称
podman-stats - Display a live stream of one or more container’s resource usage statistics
podman-stats - 显示一个或多个容器的资源使用统计数据的实时流
SYNOPSIS¶ 概要
podman stats [options] [container]
podman stats [选项] [容器]
podman container stats [options] [container]
podman container stats [选项] [容器]
DESCRIPTION¶ 描述
Display a live stream of one or more containers’ resource usage statistics
显示一个或多个容器的资源使用统计的实时流
Note: Podman stats does not work in rootless environments that use CGroups V1.
Podman stats relies on CGroup information for statistics, and CGroup v1 is not
supported for rootless use cases.
注意:Podman stats 在使用 CGroups V1 的无根环境中无法工作。Podman stats 依赖于 CGroup 信息进行统计,而 CGroup v1 不支持无根使用情况。
Note: Rootless environments that use CGroups V2 are not able to report statistics
about their networking usage.
注意:使用 CGroups V2 的无根环境无法报告有关其网络使用情况的统计信息。
OPTIONS¶ 选项
--all, -a¶
Show all containers. Only running containers are shown by default
显示所有容器。默认情况下只显示正在运行的容器
--format=template¶ --format=template
Pretty-print container statistics to JSON or using a Go template
将容器统计信息漂亮地打印成 JSON 或使用 Go 模板
Valid placeholders for the Go template are listed below:
Go 模板的有效占位符如下所示:
Placeholder |
Description |
---|---|
.AvgCPU |
Average CPU, full precision float |
.AVGCPU |
Average CPU, formatted as a percent |
.BlockInput |
Total data read from block device |
.BlockIO |
Total data read/total data written to block device |
.BlockOutput |
Total data written to block device |
.ContainerID |
Container ID, full (untruncated) hash |
.ContainerStats … |
Nested structure, for experts only |
.CPU |
Percent CPU, full precision float |
.CPUNano |
CPU Usage, total, in nanoseconds |
.CPUPerc |
Percentage of CPU used 使用的 CPU 百分比 |
.CPUSystemNano |
CPU Usage, kernel, in nanoseconds |
.Duration |
Same as CPUNano 与 CPUNano 相同 |
.ID |
Container ID, truncated 容器 ID,已截断 |
.MemLimit |
Memory limit, in bytes 内存限制,以字节为单位 |
.MemPerc |
Memory percentage used 内存使用百分比 |
.MemUsage |
Memory usage 内存使用量 |
.MemUsageBytes |
Memory usage (IEC) 内存使用量(IEC) |
.Name |
Container Name 容器名称 |
.NetIO |
Network IO 网络 IO |
.Network … .网络 … |
Network I/O, separated by network interface |
.PerCPU |
CPU time consumed by all tasks [1] |
.PIDs |
Number of PIDs 进程 ID 数量 |
.PIDS |
Number of PIDs (yes, we know this is a dup) |
.SystemNano |
Current system datetime, nanoseconds since epoch |
.Up |
Duration (CPUNano), in human-readable form |
.UpTime |
Same as Up 与 Up 相同 |
[1] Cgroups V1 only
[1] 仅限 Cgroups V1
When using a Go template, precede the format with table
to print headers.
在使用 Go 模板时,要在格式之前加上 table
以打印标题。
--interval, -i=seconds¶ --interval, -i=秒
Time in seconds between stats reports, defaults to 5 seconds.
在统计报告之间的秒数,默认为 5 秒。
--latest, -l¶
Instead of providing the container name or ID, use the last created container.
Note: the last started container can be from other users of Podman on the host machine.
(This option is not available with the remote Podman client, including Mac and Windows
(excluding WSL2) machines)
不要提供容器名称或 ID,而是使用最后创建的容器。注意:最后启动的容器可能来自主机上其他 Podman 用户。(此选项在远程 Podman 客户端中不可用,包括 Mac 和 Windows(不包括 WSL2)主机)
--no-reset¶
Do not clear the terminal/screen in between reporting intervals
在报告间隔之间不清除终端/屏幕
--no-stream¶
Disable streaming stats and only pull the first result, default setting is false
禁用流式统计,仅拉取第一个结果,默认设置为 false
--no-trunc¶
Do not truncate output
不截断输出
EXAMPLE¶ 例子 ¶
List statistics about all running containers without streaming mode:
列出所有运行容器的统计信息,不使用流式模式:
# podman stats -a --no-stream
ID NAME CPU % MEM USAGE / LIMIT MEM % NET IO BLOCK IO PIDS
a9f807ffaacd frosty_hodgkin -- 3.092MB / 16.7GB 0.02% -- / -- -- / -- 2
3b33001239ee sleepy_stallman -- -- / -- -- -- / -- -- / -- --
List the specified container’s statistics in streaming mode:
在流模式下列出指定容器的统计信息:
# podman stats a9f80
ID NAME CPU % MEM USAGE / LIMIT MEM % NET IO BLOCK IO PIDS
a9f807ffaacd frosty_hodgkin -- 3.092MB / 16.7GB 0.02% -- / -- -- / -- 2
List the specified statistics about the specified container in table format:
以表格格式列出指定容器的指定统计信息:
$ podman stats --no-trunc 3667 --format 'table {{ .ID }} {{ .MemUsage }}'
ID MEM USAGE / LIMIT
3667c6aacb06aac2eaffce914c01736420023d56ef9b0f4cfe58b6d6a78b7503 49.15kB / 67.17GB
List the specified container statistics in JSON format:
以 JSON 格式列出指定容器的统计信息:
# podman stats --no-stream --format=json a9f80
[
{
"id": "a9f807ffaacd",
"name": "frosty_hodgkin",
"cpu_percent": "--",
"mem_usage": "3.092MB / 16.7GB",
"mem_percent": "0.02%",
"netio": "-- / --",
"blocki": "-- / --",
"pids": "2"
}
]
List the specified container statistics in table format:
以表格格式列出指定容器的统计信息:
# podman stats --no-stream --format "table {{.ID}} {{.Name}} {{.MemUsage}}" 6eae
ID NAME MEM USAGE / LIMIT
6eae9e25a564 clever_bassi 3.031MB / 16.7GB
Note: When using a slirp4netns network with the rootlesskit port
handler, the traffic sent via the port forwarding is accounted to
the lo
device. Traffic accounted to lo
is not accounted in the
stats output.
注意:当使用 slirp4netns 网络与 rootlesskit 端口处理程序时,通过端口转发发送的流量计入 lo
设备。计入 lo
的流量不会在统计输出中计入。
SEE ALSO¶ 参见 ¶
HISTORY¶ 历史 ¶
July 2017, Originally compiled by Ryan Cole rycole@redhat.com
2017 年 7 月,最初由 Ryan Cole rycole@redhat.com 编译。