redis.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 redis = SMeasurement{
  17. Context: []SMonitorContext{
  18. {
  19. "redis", "redis",
  20. monitor.METRIC_RES_TYPE_EXT_REDIS, monitor.METRIC_DATABASE_TELE,
  21. },
  22. },
  23. Metrics: []SMetric{
  24. {
  25. "used_memory", "used_memory", monitor.METRIC_UNIT_BYTE,
  26. },
  27. {
  28. "used_memory_peak", "used_memory_peak", monitor.METRIC_UNIT_BYTE,
  29. },
  30. {
  31. "used_cpu_sys", "used_cpu_sys", monitor.METRIC_UNIT_PERCENT,
  32. },
  33. {
  34. "used_cpu_user", "used_cpu_user", monitor.METRIC_UNIT_PERCENT,
  35. },
  36. },
  37. }
  38. var redisKeyspace = SMeasurement{
  39. Context: []SMonitorContext{
  40. {
  41. "redis_keyspace", "redis_keyspace",
  42. monitor.METRIC_RES_TYPE_EXT_REDIS, monitor.METRIC_DATABASE_TELE,
  43. },
  44. },
  45. Metrics: []SMetric{
  46. {
  47. "keys", "keys", monitor.METRIC_UNIT_COUNT,
  48. },
  49. {
  50. "expires", "expires", monitor.METRIC_UNIT_COUNT,
  51. },
  52. },
  53. }