bond.go 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 bond = SMeasurement{
  17. Context: []SMonitorContext{
  18. {
  19. Name: "bond",
  20. DisplayName: "Bond interface",
  21. ResourceType: monitor.METRIC_RES_TYPE_HOST,
  22. Database: monitor.METRIC_DATABASE_TELE,
  23. },
  24. },
  25. Metrics: []SMetric{
  26. {
  27. Name: "active_slave",
  28. DisplayName: "used SNAT port count",
  29. Unit: monitor.METRIC_UNIT_COUNT,
  30. },
  31. {
  32. Name: "status",
  33. DisplayName: "Status of bond interface (down = 0, up = 1)",
  34. Unit: monitor.METRIC_UNIT_NULL,
  35. },
  36. },
  37. }
  38. var bondSlave = SMeasurement{
  39. Context: []SMonitorContext{
  40. {
  41. Name: "bond_slave",
  42. DisplayName: "Slave interfaces of bond interface",
  43. ResourceType: monitor.METRIC_RES_TYPE_HOST,
  44. Database: monitor.METRIC_DATABASE_TELE,
  45. },
  46. },
  47. Metrics: []SMetric{
  48. {
  49. Name: "status",
  50. DisplayName: "Status of bonds's slave interface (down = 0, up = 1)",
  51. Unit: monitor.METRIC_UNIT_NULL,
  52. },
  53. {
  54. Name: "failures",
  55. DisplayName: "Amount of failures for bond's slave interface",
  56. Unit: monitor.METRIC_UNIT_COUNT,
  57. },
  58. },
  59. }