mysql.go 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 mysql = SMeasurement{
  17. Context: []SMonitorContext{
  18. {
  19. "mysql", "mysql",
  20. monitor.METRIC_RES_TYPE_EXT_MYSQL, monitor.METRIC_DATABASE_TELE,
  21. },
  22. },
  23. Metrics: []SMetric{
  24. {
  25. "binary_size_bytes", "binary_size_bytes", monitor.METRIC_UNIT_BYTE,
  26. },
  27. {
  28. "binary_files_count", "binary_files_count", monitor.METRIC_UNIT_COUNT,
  29. },
  30. {
  31. "connections", "connections", monitor.METRIC_UNIT_COUNT,
  32. },
  33. {
  34. "table_io_waits_total_fetch", "table_io_waits_total_fetch", monitor.METRIC_UNIT_COUNT,
  35. },
  36. {
  37. "table_io_waits_seconds_total_fetch", "table_io_waits_seconds_total_fetch", monitor.METRIC_UNIT_MS,
  38. },
  39. {
  40. "index_io_waits_total_fetch", "index_io_waits_total_fetch", monitor.METRIC_UNIT_COUNT,
  41. },
  42. {
  43. "index_io_waits_seconds_total_fetch", "index_io_waits_seconds_total_fetch", monitor.METRIC_UNIT_MS,
  44. },
  45. {
  46. "info_schema_table_rows", "info_schema_table_rows", monitor.METRIC_UNIT_COUNT,
  47. },
  48. {
  49. "info_schema_table_size_data_length", "info_schema_table_size_data_length", monitor.METRIC_UNIT_COUNT,
  50. },
  51. {
  52. "info_schema_table_size_index_length", "info_schema_table_size_index_length", monitor.METRIC_UNIT_COUNT,
  53. },
  54. },
  55. }