Get container stats based on resource usage
/v1.33
/v1.33
/v1.33
/v1.33
GET
/containers/{id}/stats
Container
statistics.
precpu_stats
is the CPU statistic of last read, which is usedfor calculating the CPU usage percentage. It is not the same as the
cpu_stats
field.precpu_stats.online_cpus
or cpu_stats.online_cpus
isnil then for compatibility with older daemons the length of the
corresponding
cpu_usage.percpu_usage
array should be used.Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET '/v1.33/containers//stats'
Response Response Example
200 - response
{
"blkio_stats": {},
"cpu_stats": {
"cpu_usage": {
"percpu_usage": [
8646879,
24472255,
36438778,
30657443
],
"total_usage": 100215355,
"usage_in_kernelmode": 30000000,
"usage_in_usermode": 50000000
},
"online_cpus": 4,
"system_cpu_usage": 739306590000000,
"throttling_data": {
"periods": 0,
"throttled_periods": 0,
"throttled_time": 0
}
},
"memory_stats": {
"failcnt": 0,
"limit": 67108864,
"max_usage": 6651904,
"stats": {
"active_anon": 6537216,
"active_file": 0,
"cache": 0,
"hierarchical_memory_limit": 67108864,
"inactive_anon": 0,
"inactive_file": 0,
"mapped_file": 0,
"pgfault": 964,
"pgmajfault": 0,
"pgpgin": 477,
"pgpgout": 414,
"rss": 6537216,
"rss_huge": 6291456,
"total_active_anon": 6537216,
"total_active_file": 0,
"total_cache": 0,
"total_inactive_anon": 0,
"total_inactive_file": 0,
"total_mapped_file": 0,
"total_pgfault": 964,
"total_pgmajfault": 0,
"total_pgpgin": 477,
"total_pgpgout": 414,
"total_rss": 6537216,
"total_rss_huge": 6291456,
"total_unevictable": 0,
"total_writeback": 0,
"unevictable": 0,
"writeback": 0
},
"usage": 6537216
},
"networks": {
"eth0": {
"rx_bytes": 5338,
"rx_dropped": 0,
"rx_errors": 0,
"rx_packets": 36,
"tx_bytes": 648,
"tx_dropped": 0,
"tx_errors": 0,
"tx_packets": 8
},
"eth5": {
"rx_bytes": 4641,
"rx_dropped": 0,
"rx_errors": 0,
"rx_packets": 26,
"tx_bytes": 690,
"tx_dropped": 0,
"tx_errors": 0,
"tx_packets": 9
}
},
"pids_stats": {
"current": 3
},
"precpu_stats": {
"cpu_usage": {
"percpu_usage": [
8646879,
24350896,
36438778,
30657443
],
"total_usage": 100093996,
"usage_in_kernelmode": 30000000,
"usage_in_usermode": 50000000
},
"online_cpus": 4,
"system_cpu_usage": 9492140000000,
"throttling_data": {
"periods": 0,
"throttled_periods": 0,
"throttled_time": 0
}
},
"read": "2015-01-08T22:57:31.547920715Z"
}
Request
Path Params
id
string
required
Query Params
stream
string
optional
Responses
Modified at 2022-09-10 17:56:06