net.go 2.9 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 net = SMeasurement{
  17. Context: []SMonitorContext{
  18. {
  19. Name: "net",
  20. DisplayName: "Network interface and protocol usage",
  21. ResourceType: monitor.METRIC_RES_TYPE_HOST,
  22. Database: monitor.METRIC_DATABASE_TELE,
  23. },
  24. {
  25. Name: "agent_net",
  26. DisplayName: "Network interface and protocol usage",
  27. ResourceType: monitor.METRIC_RES_TYPE_AGENT,
  28. Database: monitor.METRIC_DATABASE_TELE,
  29. },
  30. },
  31. Metrics: []SMetric{
  32. {
  33. Name: "bps_sent",
  34. DisplayName: "Send traffic per second",
  35. Unit: monitor.METRIC_UNIT_BPS,
  36. },
  37. {
  38. Name: "bps_recv",
  39. DisplayName: "Received traffic per second",
  40. Unit: monitor.METRIC_UNIT_BPS,
  41. },
  42. {
  43. Name: "pps_recv",
  44. DisplayName: "Received packets per second",
  45. Unit: monitor.METRIC_UNIT_PPS,
  46. },
  47. {
  48. Name: "pps_sent",
  49. DisplayName: "Send packets per second",
  50. Unit: monitor.METRIC_UNIT_PPS,
  51. },
  52. {
  53. Name: "bytes_sent",
  54. DisplayName: "The total number of bytes sent by the network interface",
  55. Unit: monitor.METRIC_UNIT_BYTE,
  56. },
  57. {
  58. Name: "bytes_recv",
  59. DisplayName: "The total number of bytes received by the network interface",
  60. Unit: monitor.METRIC_UNIT_BYTE,
  61. },
  62. {
  63. Name: "packets_sent",
  64. DisplayName: "The total number of packets sent by the network interface",
  65. Unit: monitor.METRIC_UNIT_COUNT,
  66. },
  67. {
  68. Name: "packets_recv",
  69. DisplayName: "The total number of packets received by the network interface",
  70. Unit: monitor.METRIC_UNIT_COUNT,
  71. },
  72. {
  73. Name: "err_in",
  74. DisplayName: "The total number of receive errors detected by the network interface",
  75. Unit: monitor.METRIC_UNIT_COUNT,
  76. },
  77. {
  78. Name: "err_out",
  79. DisplayName: "The total number of transmission errors detected by the network interface",
  80. Unit: monitor.METRIC_UNIT_COUNT,
  81. },
  82. {
  83. Name: "drop_in",
  84. DisplayName: "The total number of received packets dropped by the network interface",
  85. Unit: monitor.METRIC_UNIT_COUNT,
  86. },
  87. {
  88. Name: "drop_out",
  89. DisplayName: "The total number of transmission packets dropped by the network interface",
  90. Unit: monitor.METRIC_UNIT_COUNT,
  91. },
  92. },
  93. }