1podman-stats(1) General Commands Manual podman-stats(1)
2
3
4
6 podman-stats - Display a live stream of one or more container's re‐
7 source usage statistics
8
9
11 podman stats [options] [container]
12
13
14 podman container stats [options] [container]
15
16
18 Display a live stream of one or more containers' resource usage statis‐
19 tics
20
21
22 Note: Podman stats does not work in rootless environments that use
23 CGroups V1. Podman stats relies on CGroup information for statistics,
24 and CGroup v1 is not supported for rootless use cases.
25
26
27 Note: Rootless environments that use CGroups V2 are not able to report
28 statistics about their networking usage.
29
30
32 --all, -a
33 Show all containers. Only running containers are shown by default
34
35
36 --format=template
37 Pretty-print container statistics to JSON or using a Go template
38
39
40 Valid placeholders for the Go template are listed below:
41
42
43 ┌────────────────────┬────────────────────────────┐
44 │Placeholder │ Description │
45 ├────────────────────┼────────────────────────────┤
46 │.AvgCPU │ Average CPU, full preci‐ │
47 │ │ sion float │
48 ├────────────────────┼────────────────────────────┤
49 │.AVGCPU │ Average CPU, formatted as │
50 │ │ a percent │
51 ├────────────────────┼────────────────────────────┤
52 │.BlockInput │ Total data read from block │
53 │ │ device │
54 ├────────────────────┼────────────────────────────┤
55 │.BlockIO │ Total data read/total data │
56 │ │ written to block device │
57 ├────────────────────┼────────────────────────────┤
58 │.BlockOutput │ Total data written to │
59 │ │ block device │
60 ├────────────────────┼────────────────────────────┤
61 │.ContainerID │ Container ID, full (un‐ │
62 │ │ truncated) hash │
63 ├────────────────────┼────────────────────────────┤
64 │.ContainerStats ... │ Nested structure, for ex‐ │
65 │ │ perts only │
66 ├────────────────────┼────────────────────────────┤
67 │.CPU │ Percent CPU, full preci‐ │
68 │ │ sion float │
69 ├────────────────────┼────────────────────────────┤
70 │.CPUNano │ CPU Usage, total, in │
71 │ │ nanoseconds │
72 ├────────────────────┼────────────────────────────┤
73 │.CPUPerc │ Percentage of CPU used │
74 ├────────────────────┼────────────────────────────┤
75 │.CPUSystemNano │ CPU Usage, kernel, in │
76 │ │ nanoseconds │
77 ├────────────────────┼────────────────────────────┤
78 │.Duration │ Same as CPUNano │
79 ├────────────────────┼────────────────────────────┤
80 │.ID │ Container ID, truncated │
81 ├────────────────────┼────────────────────────────┤
82 │.MemLimit │ Memory limit, in bytes │
83 ├────────────────────┼────────────────────────────┤
84 │.MemPerc │ Memory percentage used │
85 ├────────────────────┼────────────────────────────┤
86 │.MemUsage │ Memory usage │
87 ├────────────────────┼────────────────────────────┤
88 │.MemUsageBytes │ Memory usage (IEC) │
89 ├────────────────────┼────────────────────────────┤
90 │.Name │ Container Name │
91 ├────────────────────┼────────────────────────────┤
92 │.NetInput │ Network Input │
93 ├────────────────────┼────────────────────────────┤
94 │.NetIO │ Network IO │
95 ├────────────────────┼────────────────────────────┤
96 │.NetOutput │ Network Output │
97 ├────────────────────┼────────────────────────────┤
98 │.PerCPU │ CPU time consumed by all │
99 │ │ tasks [1] │
100 ├────────────────────┼────────────────────────────┤
101 │.PIDs │ Number of PIDs │
102 ├────────────────────┼────────────────────────────┤
103 │.PIDS │ Number of PIDs (yes, we │
104 │ │ know it's a dup) │
105 ├────────────────────┼────────────────────────────┤
106 │.SystemNano │ Current system datetime, │
107 │ │ nanoseconds since epoch │
108 ├────────────────────┼────────────────────────────┤
109 │.Up │ Duration (CPUNano), in hu‐ │
110 │ │ man-readable form │
111 ├────────────────────┼────────────────────────────┤
112 │.UpTime │ Same as UpTime │
113 └────────────────────┴────────────────────────────┘
114
115 [1] Cgroups V1 only
116
117
118 When using a Go template, precede the format with table to print head‐
119 ers.
120
121
122 --interval, -i=seconds
123 Time in seconds between stats reports, defaults to 5 seconds.
124
125
126 --latest, -l
127 Instead of providing the container name or ID, use the last created
128 container. Note: the last started container can be from other users of
129 Podman on the host machine. (This option is not available with the re‐
130 mote Podman client, including Mac and Windows (excluding WSL2) ma‐
131 chines)
132
133
134 --no-reset
135 Do not clear the terminal/screen in between reporting intervals
136
137
138 --no-stream
139 Disable streaming stats and only pull the first result, default setting
140 is false
141
142
143 --no-trunc
144 Do not truncate output
145
146
148 # podman stats -a --no-stream
149 ID NAME CPU % MEM USAGE / LIMIT MEM % NET IO BLOCK IO PIDS
150 a9f807ffaacd frosty_hodgkin -- 3.092MB / 16.7GB 0.02% -- / -- -- / -- 2
151 3b33001239ee sleepy_stallman -- -- / -- -- -- / -- -- / -- --
152
153
154
155 # podman stats --no-stream a9f80
156 ID NAME CPU % MEM USAGE / LIMIT MEM % NET IO BLOCK IO PIDS
157 a9f807ffaacd frosty_hodgkin -- 3.092MB / 16.7GB 0.02% -- / -- -- / -- 2
158
159
160
161 $ podman stats --no-trunc 3667 --format 'table {{ .ID }} {{ .MemUsage }}'
162 ID MEM USAGE / LIMIT
163 3667c6aacb06aac2eaffce914c01736420023d56ef9b0f4cfe58b6d6a78b7503 49.15kB / 67.17GB
164
165
166
167 # podman stats --no-stream --format=json a9f80
168 [
169 {
170 "id": "a9f807ffaacd",
171 "name": "frosty_hodgkin",
172 "cpu_percent": "--",
173 "mem_usage": "3.092MB / 16.7GB",
174 "mem_percent": "0.02%",
175 "netio": "-- / --",
176 "blocki": "-- / --",
177 "pids": "2"
178 }
179 ]
180
181
182
183 # podman stats --no-stream --format "table {{.ID}} {{.Name}} {{.MemUsage}}" 6eae
184 ID NAME MEM USAGE / LIMIT
185 6eae9e25a564 clever_bassi 3.031MB / 16.7GB
186
187
188
189 Note: When using a slirp4netns network with the rootlesskit port han‐
190 dler, the traffic sent via the port forwarding is accounted to the lo
191 device. Traffic accounted to lo is not accounted in the stats output.
192
193
195 podman(1)
196
197
199 July 2017, Originally compiled by Ryan Cole rycole@redhat.com
200 ⟨mailto:rycole@redhat.com⟩
201
202
203
204 podman-stats(1)