cpu.go 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. // Copyright 2019 Yunion
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package measurements
  15. import "yunion.io/x/onecloud/pkg/apis/monitor"
  16. var cpu = SMeasurement{
  17. Context: []SMonitorContext{
  18. {
  19. Name: "cpu",
  20. DisplayName: "CPU usage",
  21. ResourceType: monitor.METRIC_RES_TYPE_HOST,
  22. Database: monitor.METRIC_DATABASE_TELE,
  23. },
  24. {
  25. Name: "agent_cpu",
  26. DisplayName: "CPU usage",
  27. ResourceType: monitor.METRIC_RES_TYPE_AGENT,
  28. Database: monitor.METRIC_DATABASE_TELE,
  29. },
  30. },
  31. Metrics: []SMetric{
  32. {
  33. Name: "usage_active",
  34. DisplayName: "CPU active state utilization rate",
  35. Unit: monitor.METRIC_UNIT_PERCENT,
  36. },
  37. {
  38. Name: "usage_idle",
  39. DisplayName: "CPU idle state utilization rate",
  40. Unit: monitor.METRIC_UNIT_PERCENT,
  41. },
  42. {
  43. Name: "usage_system",
  44. DisplayName: "CPU system state utilization rate",
  45. Unit: monitor.METRIC_UNIT_PERCENT,
  46. },
  47. {
  48. Name: "usage_user",
  49. DisplayName: "CPU user mode utilization rate",
  50. Unit: monitor.METRIC_UNIT_PERCENT,
  51. },
  52. {
  53. Name: "usage_iowait",
  54. DisplayName: "CPU IO usage",
  55. Unit: monitor.METRIC_UNIT_PERCENT,
  56. },
  57. {
  58. Name: "usage_irq",
  59. DisplayName: "CPU IRQ usage",
  60. Unit: monitor.METRIC_UNIT_PERCENT,
  61. },
  62. {
  63. Name: "usage_guest",
  64. DisplayName: "CPU guest usage",
  65. Unit: monitor.METRIC_UNIT_PERCENT,
  66. },
  67. {
  68. Name: "usage_nice",
  69. DisplayName: "CPU priority switch utilization",
  70. Unit: monitor.METRIC_UNIT_PERCENT,
  71. },
  72. {
  73. Name: "usage_softirq",
  74. DisplayName: "CPU softirq usage",
  75. Unit: monitor.METRIC_UNIT_PERCENT,
  76. },
  77. {
  78. Name: "usage_steal",
  79. DisplayName: "CPU steal usage",
  80. Unit: monitor.METRIC_UNIT_PERCENT,
  81. },
  82. {
  83. Name: "usage_guest_nice",
  84. DisplayName: "CPU guest nice usage",
  85. Unit: monitor.METRIC_UNIT_PERCENT,
  86. },
  87. },
  88. }