dcs.go 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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 dcsRedisCpu = SMeasurement{
  17. Context: []SMonitorContext{
  18. {
  19. "dcs_cpu", "Redis CPU usage", monitor.METRIC_RES_TYPE_REDIS,
  20. monitor.METRIC_DATABASE_TELE,
  21. },
  22. },
  23. Metrics: []SMetric{
  24. {
  25. "usage_percent", "CPU active state utilization rate", monitor.METRIC_UNIT_PERCENT,
  26. },
  27. {
  28. "server_load", "server load", monitor.METRIC_UNIT_PERCENT,
  29. },
  30. },
  31. }
  32. var dcsRedisMem = SMeasurement{
  33. Context: []SMonitorContext{
  34. {
  35. "dcs_mem", "Redis memory", monitor.METRIC_RES_TYPE_REDIS,
  36. monitor.METRIC_DATABASE_TELE,
  37. },
  38. },
  39. Metrics: []SMetric{
  40. {
  41. "used_percent", "Used memory rate", monitor.METRIC_UNIT_PERCENT,
  42. },
  43. },
  44. }
  45. var dcsRedisNetio = SMeasurement{
  46. Context: []SMonitorContext{
  47. {
  48. "dcs_netio", "Redis network traffic",
  49. monitor.METRIC_RES_TYPE_REDIS,
  50. monitor.METRIC_DATABASE_TELE,
  51. },
  52. },
  53. Metrics: []SMetric{
  54. {
  55. "bps_recv", "Received traffic per second", monitor.METRIC_UNIT_BPS,
  56. },
  57. {
  58. "bps_sent", "Send traffic per second", monitor.METRIC_UNIT_BPS,
  59. },
  60. },
  61. }
  62. var dcsRedisConn = SMeasurement{
  63. Context: []SMonitorContext{
  64. {
  65. "dcs_conn", "Redis connect", monitor.METRIC_RES_TYPE_REDIS,
  66. monitor.METRIC_DATABASE_TELE,
  67. },
  68. },
  69. Metrics: []SMetric{
  70. {
  71. "used_percent", "Connection usage", monitor.METRIC_UNIT_PERCENT,
  72. },
  73. {
  74. "errors", "Connection errors", monitor.METRIC_UNIT_COUNT,
  75. },
  76. },
  77. }
  78. var dcsRedisInstanceOpt = SMeasurement{
  79. Context: []SMonitorContext{
  80. {
  81. "dcs_instantopt", "Redis operator",
  82. monitor.METRIC_RES_TYPE_REDIS, monitor.METRIC_DATABASE_TELE,
  83. },
  84. },
  85. Metrics: []SMetric{
  86. {
  87. "opt_sec", "Number of commands processed per second", monitor.METRIC_UNIT_COUNT,
  88. },
  89. },
  90. }
  91. var dcsRedisCachekeys = SMeasurement{
  92. Context: []SMonitorContext{
  93. {
  94. "dcs_cachekeys", "Redis keys", monitor.METRIC_RES_TYPE_REDIS,
  95. monitor.METRIC_DATABASE_TELE,
  96. },
  97. },
  98. Metrics: []SMetric{
  99. {
  100. "key_count", "Number of cache keys", monitor.METRIC_UNIT_COUNT,
  101. },
  102. },
  103. }
  104. var dcsRedisDatamem = SMeasurement{
  105. Context: []SMonitorContext{
  106. {
  107. "dcs_datamem", "Redis data memory", monitor.METRIC_RES_TYPE_REDIS,
  108. monitor.METRIC_DATABASE_TELE,
  109. },
  110. },
  111. Metrics: []SMetric{
  112. {
  113. "used_byte", "Data node memory usage", monitor.METRIC_UNIT_BYTE,
  114. },
  115. },
  116. }