rds.go 2.2 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 rdsConn = SMeasurement{
  17. Context: []SMonitorContext{
  18. {
  19. "rds_conn", "Rds connection", monitor.METRIC_RES_TYPE_RDS,
  20. monitor.METRIC_DATABASE_TELE,
  21. },
  22. },
  23. Metrics: []SMetric{
  24. {
  25. "used_percent", "Connection usage", monitor.METRIC_UNIT_PERCENT,
  26. },
  27. {
  28. "active_count", "active connection count", monitor.METRIC_UNIT_COUNT,
  29. },
  30. {
  31. "failed_count", "failed connection count", monitor.METRIC_UNIT_COUNT,
  32. },
  33. },
  34. }
  35. var rdsCpu = SMeasurement{
  36. Context: []SMonitorContext{
  37. {
  38. "rds_cpu", "Rds CPU usage", monitor.METRIC_RES_TYPE_RDS,
  39. monitor.METRIC_DATABASE_TELE,
  40. },
  41. },
  42. Metrics: []SMetric{
  43. {
  44. "usage_active", "CPU active state utilization rate", monitor.METRIC_UNIT_PERCENT,
  45. },
  46. },
  47. }
  48. var rdsMem = SMeasurement{
  49. Context: []SMonitorContext{
  50. {
  51. "rds_mem", "Rds memory", monitor.METRIC_RES_TYPE_RDS,
  52. monitor.METRIC_DATABASE_TELE,
  53. },
  54. },
  55. Metrics: []SMetric{
  56. {
  57. "used_percent", "Used memory rate", monitor.METRIC_UNIT_PERCENT,
  58. },
  59. },
  60. }
  61. var rdsNetio = SMeasurement{
  62. Context: []SMonitorContext{
  63. {
  64. "rds_netio", "Rds network traffic", monitor.METRIC_RES_TYPE_RDS,
  65. monitor.METRIC_DATABASE_TELE,
  66. },
  67. },
  68. Metrics: []SMetric{
  69. {
  70. "bps_recv", "Received traffic per second", monitor.METRIC_UNIT_BPS,
  71. },
  72. {
  73. "bps_sent", "Send traffic per second", monitor.METRIC_UNIT_BPS,
  74. },
  75. },
  76. }
  77. var rdsDisk = SMeasurement{
  78. Context: []SMonitorContext{
  79. {
  80. "rds_disk", "Rds disk usage", monitor.METRIC_RES_TYPE_RDS,
  81. monitor.METRIC_DATABASE_TELE,
  82. },
  83. },
  84. Metrics: []SMetric{
  85. {
  86. "used_percent", "Percentage of used disks", monitor.METRIC_UNIT_PERCENT,
  87. },
  88. },
  89. }