containers/{id}/stats
Docker endpoint返回包含以下内容的结果:
blkio_stats: {
io_service_bytes_recursive: [
{ major: 8, minor: 0, op: "Read", value: 34185216 },
{ major: 8, minor: 0, op: "Write", value: 40960 },
{ major: 8, minor: 0, op: "Sync", value: 34226176 },
{ major: 8, minor: 0, op: "Async", value: 0 },
{ major: 8, minor: 0, op: "Total", value: 34226176 },
{ major: 8, minor: 0, op: "Read", value: 34185216 },
{ major: 8, minor: 0, op: "Write", value: 40960 },
{ major: 8, minor: 0, op: "Sync", value: 34226176 },
{ major: 8, minor: 0, op: "Async", value: 0 },
{ major: 8, minor: 0, op: "Total", value: 34226176 }
],
io_serviced_recursive: [
{ major: 8, minor: 0, op: "Read", value: 1042 },
{ major: 8, minor: 0, op: "Write", value: 4 },
{ major: 8, minor: 0, op: "Sync", value: 1046 },
{ major: 8, minor: 0, op: "Async", value: 0 },
{ major: 8, minor: 0, op: "Total", value: 1046 },
{ major: 8, minor: 0, op: "Read", value: 1042 },
{ major: 8, minor: 0, op: "Write", value: 4 },
{ major: 8, minor: 0, op: "Sync", value: 1046 },
{ major: 8, minor: 0, op: "Async", value: 0 },
{ major: 8, minor: 0, op: "Total", value: 1046 }
],
... more fields (without duplicated lines)...
}
似乎字段io_service_bytes_recursive
和io_serviced_recursive
的行重复。为什么会这样?
此外,在命令行上调用docker stats
将返回Read
个字节的总和(在本示例中为34185216 + 34185216
),并且类似地返回Write
个字节。这些值正确吗?