使用Docker REST API进行容器统计时blkio_stats中的重复行

时间:2019-05-21 13:12:13

标签: docker

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_recursiveio_serviced_recursive的行重复。为什么会这样?

此外,在命令行上调用docker stats将返回Read个字节的总和(在本示例中为34185216 + 34185216),并且类似地返回Write个字节。这些值正确吗?

0 个答案:

没有答案