mem.go 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 mem = SMeasurement{
  17. Context: []SMonitorContext{
  18. {
  19. Name: "mem",
  20. DisplayName: "Memory",
  21. ResourceType: monitor.METRIC_RES_TYPE_HOST,
  22. Database: monitor.METRIC_DATABASE_TELE,
  23. },
  24. {
  25. Name: "agent_mem",
  26. DisplayName: "Memory",
  27. ResourceType: monitor.METRIC_RES_TYPE_AGENT,
  28. Database: monitor.METRIC_DATABASE_TELE,
  29. },
  30. },
  31. Metrics: []SMetric{
  32. {
  33. Name: "used_percent",
  34. DisplayName: "Used memory rate",
  35. Unit: monitor.METRIC_UNIT_PERCENT,
  36. },
  37. {
  38. Name: "available_percent",
  39. DisplayName: "Available memory rate",
  40. Unit: monitor.METRIC_UNIT_PERCENT,
  41. },
  42. {
  43. Name: "free_percent",
  44. DisplayName: "Free memory rate",
  45. Unit: monitor.METRIC_UNIT_PERCENT,
  46. },
  47. {
  48. Name: "used",
  49. DisplayName: "Used memory",
  50. Unit: monitor.METRIC_UNIT_BYTE,
  51. },
  52. {
  53. Name: "free",
  54. DisplayName: "Free memory",
  55. Unit: monitor.METRIC_UNIT_BYTE,
  56. },
  57. {
  58. Name: "active",
  59. DisplayName: "The amount of active memory",
  60. Unit: monitor.METRIC_UNIT_BYTE,
  61. },
  62. {
  63. Name: "inactive",
  64. DisplayName: "The amount of inactive memory",
  65. Unit: monitor.METRIC_UNIT_BYTE,
  66. },
  67. {
  68. Name: "cached",
  69. DisplayName: "Cache memory",
  70. Unit: monitor.METRIC_UNIT_BYTE,
  71. },
  72. {
  73. Name: "buffered",
  74. DisplayName: "Buffer memory",
  75. Unit: monitor.METRIC_UNIT_BYTE,
  76. },
  77. {
  78. Name: "slab",
  79. DisplayName: "Number of kernel caches",
  80. Unit: monitor.METRIC_UNIT_BYTE,
  81. },
  82. {
  83. Name: "available",
  84. DisplayName: "Available memory",
  85. Unit: monitor.METRIC_UNIT_BYTE,
  86. },
  87. {
  88. Name: "total",
  89. DisplayName: "Total memory",
  90. Unit: monitor.METRIC_UNIT_BYTE,
  91. },
  92. },
  93. }