disk.go 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 disk = SMeasurement{
  17. Context: []SMonitorContext{
  18. {
  19. Name: "disk",
  20. DisplayName: "Disk usage",
  21. ResourceType: monitor.METRIC_RES_TYPE_HOST,
  22. Database: monitor.METRIC_DATABASE_TELE,
  23. },
  24. {
  25. Name: "agent_disk",
  26. DisplayName: "Disk usage",
  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: "Percentage of used disks",
  35. Unit: monitor.METRIC_UNIT_PERCENT,
  36. },
  37. {
  38. Name: "free",
  39. DisplayName: "Free space size",
  40. Unit: monitor.METRIC_UNIT_BYTE,
  41. },
  42. {
  43. Name: "used",
  44. DisplayName: "Used disk size",
  45. Unit: monitor.METRIC_UNIT_BYTE,
  46. },
  47. {
  48. Name: "total",
  49. DisplayName: "Total disk size",
  50. Unit: monitor.METRIC_UNIT_BYTE,
  51. },
  52. {
  53. Name: "inodes_used_percent",
  54. DisplayName: "Percentage of used inodes",
  55. Unit: monitor.METRIC_UNIT_PERCENT,
  56. },
  57. {
  58. Name: "inodes_free",
  59. DisplayName: "Available inode",
  60. Unit: monitor.METRIC_UNIT_COUNT,
  61. },
  62. {
  63. Name: "inodes_used",
  64. DisplayName: "Number of inodes used",
  65. Unit: monitor.METRIC_UNIT_COUNT,
  66. },
  67. {
  68. Name: "inodes_total",
  69. DisplayName: "Total inodes",
  70. Unit: monitor.METRIC_UNIT_COUNT,
  71. },
  72. {
  73. Name: "read_only",
  74. DisplayName: "Test if disk is read only",
  75. Unit: monitor.METRIC_UNIT_NULL,
  76. },
  77. },
  78. }