metrics.proto 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. syntax = "proto3";
  2. package io.containerd.cgroups.v1;
  3. option go_package = "github.com/containerd/cgroups/cgroup1/stats";
  4. message Metrics {
  5. repeated HugetlbStat hugetlb = 1;
  6. PidsStat pids = 2;
  7. CPUStat cpu = 3;
  8. MemoryStat memory = 4;
  9. BlkIOStat blkio = 5;
  10. RdmaStat rdma = 6;
  11. repeated NetworkStat network = 7;
  12. CgroupStats cgroup_stats = 8;
  13. MemoryOomControl memory_oom_control = 9;
  14. }
  15. message HugetlbStat {
  16. uint64 usage = 1;
  17. uint64 max = 2;
  18. uint64 failcnt = 3;
  19. string pagesize = 4;
  20. }
  21. message PidsStat {
  22. uint64 current = 1;
  23. uint64 limit = 2;
  24. }
  25. message CPUStat {
  26. CPUUsage usage = 1;
  27. Throttle throttling = 2;
  28. }
  29. message CPUUsage {
  30. // values in nanoseconds
  31. uint64 total = 1;
  32. uint64 kernel = 2;
  33. uint64 user = 3;
  34. repeated uint64 per_cpu = 4;
  35. }
  36. message Throttle {
  37. uint64 periods = 1;
  38. uint64 throttled_periods = 2;
  39. uint64 throttled_time = 3;
  40. }
  41. message MemoryStat {
  42. uint64 cache = 1;
  43. uint64 rss = 2;
  44. uint64 rss_huge = 3;
  45. uint64 mapped_file = 4;
  46. uint64 dirty = 5;
  47. uint64 writeback = 6;
  48. uint64 pg_pg_in = 7;
  49. uint64 pg_pg_out = 8;
  50. uint64 pg_fault = 9;
  51. uint64 pg_maj_fault = 10;
  52. uint64 inactive_anon = 11;
  53. uint64 active_anon = 12;
  54. uint64 inactive_file = 13;
  55. uint64 active_file = 14;
  56. uint64 unevictable = 15;
  57. uint64 hierarchical_memory_limit = 16;
  58. uint64 hierarchical_swap_limit = 17;
  59. uint64 total_cache = 18;
  60. uint64 total_rss = 19;
  61. uint64 total_rss_huge = 20;
  62. uint64 total_mapped_file = 21;
  63. uint64 total_dirty = 22;
  64. uint64 total_writeback = 23;
  65. uint64 total_pg_pg_in = 24;
  66. uint64 total_pg_pg_out = 25;
  67. uint64 total_pg_fault = 26;
  68. uint64 total_pg_maj_fault = 27;
  69. uint64 total_inactive_anon = 28;
  70. uint64 total_active_anon = 29;
  71. uint64 total_inactive_file = 30;
  72. uint64 total_active_file = 31;
  73. uint64 total_unevictable = 32;
  74. MemoryEntry usage = 33;
  75. MemoryEntry swap = 34;
  76. MemoryEntry kernel = 35;
  77. MemoryEntry kernel_tcp = 36;
  78. }
  79. message MemoryEntry {
  80. uint64 limit = 1;
  81. uint64 usage = 2;
  82. uint64 max = 3;
  83. uint64 failcnt = 4;
  84. }
  85. message MemoryOomControl {
  86. uint64 oom_kill_disable = 1;
  87. uint64 under_oom = 2;
  88. uint64 oom_kill = 3;
  89. }
  90. message BlkIOStat {
  91. repeated BlkIOEntry io_service_bytes_recursive = 1;
  92. repeated BlkIOEntry io_serviced_recursive = 2;
  93. repeated BlkIOEntry io_queued_recursive = 3;
  94. repeated BlkIOEntry io_service_time_recursive = 4;
  95. repeated BlkIOEntry io_wait_time_recursive = 5;
  96. repeated BlkIOEntry io_merged_recursive = 6;
  97. repeated BlkIOEntry io_time_recursive = 7;
  98. repeated BlkIOEntry sectors_recursive = 8;
  99. }
  100. message BlkIOEntry {
  101. string op = 1;
  102. string device = 2;
  103. uint64 major = 3;
  104. uint64 minor = 4;
  105. uint64 value = 5;
  106. }
  107. message RdmaStat {
  108. repeated RdmaEntry current = 1;
  109. repeated RdmaEntry limit = 2;
  110. }
  111. message RdmaEntry {
  112. string device = 1;
  113. uint32 hca_handles = 2;
  114. uint32 hca_objects = 3;
  115. }
  116. message NetworkStat {
  117. string name = 1;
  118. uint64 rx_bytes = 2;
  119. uint64 rx_packets = 3;
  120. uint64 rx_errors = 4;
  121. uint64 rx_dropped = 5;
  122. uint64 tx_bytes = 6;
  123. uint64 tx_packets = 7;
  124. uint64 tx_errors = 8;
  125. uint64 tx_dropped = 9;
  126. }
  127. // CgroupStats exports per-cgroup statistics.
  128. message CgroupStats {
  129. // number of tasks sleeping
  130. uint64 nr_sleeping = 1;
  131. // number of tasks running
  132. uint64 nr_running = 2;
  133. // number of tasks in stopped state
  134. uint64 nr_stopped = 3;
  135. // number of tasks in uninterruptible state
  136. uint64 nr_uninterruptible = 4;
  137. // number of tasks waiting on IO
  138. uint64 nr_io_wait = 5;
  139. }