oss.go 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 ossLatency = SMeasurement{
  17. Context: []SMonitorContext{
  18. {
  19. "oss_latency", "Object storage latency",
  20. monitor.METRIC_RES_TYPE_OSS, monitor.METRIC_DATABASE_TELE,
  21. },
  22. },
  23. Metrics: []SMetric{
  24. {
  25. "req_late", "Request average E2E delay", monitor.METRIC_UNIT_MS,
  26. },
  27. },
  28. }
  29. var ossNetio = SMeasurement{
  30. Context: []SMonitorContext{
  31. {
  32. "oss_netio", "Object storage network traffic",
  33. monitor.METRIC_RES_TYPE_OSS, monitor.METRIC_DATABASE_TELE,
  34. },
  35. },
  36. Metrics: []SMetric{
  37. {
  38. "bps_recv", "Receive byte", monitor.METRIC_UNIT_BYTE,
  39. },
  40. {
  41. "bps_sent", "Send byte", monitor.METRIC_UNIT_BYTE,
  42. },
  43. },
  44. }
  45. var ossReq = SMeasurement{
  46. Context: []SMonitorContext{
  47. {
  48. "oss_req", "Object store request", monitor.METRIC_RES_TYPE_OSS,
  49. monitor.METRIC_DATABASE_TELE,
  50. },
  51. },
  52. Metrics: []SMetric{
  53. {
  54. "req_count", "request count", monitor.METRIC_UNIT_COUNT,
  55. },
  56. },
  57. }
  58. var ossPerfMon = SMeasurement{
  59. Context: []SMonitorContext{
  60. {
  61. Name: "bucket_perf",
  62. DisplayName: "Object storage bucket performance monitor",
  63. ResourceType: monitor.METRIC_RES_TYPE_OSS,
  64. Database: monitor.METRIC_DATABASE_TELE,
  65. },
  66. },
  67. Metrics: []SMetric{
  68. {
  69. Name: "upload_delay_ms",
  70. DisplayName: "Bucket upload delay in milliseconds",
  71. Unit: monitor.METRIC_UNIT_MS,
  72. },
  73. {
  74. Name: "download_delay_ms",
  75. DisplayName: "Bucket download delay in milliseconds",
  76. Unit: monitor.METRIC_UNIT_MS,
  77. },
  78. {
  79. Name: "delete_delay_ms",
  80. DisplayName: "Bucket delete delay in milliseconds",
  81. Unit: monitor.METRIC_UNIT_MS,
  82. },
  83. {
  84. Name: "upload_rate_mbps",
  85. DisplayName: "Bucket upload rate in megabits per second",
  86. Unit: monitor.METRIC_UNIT_MBPS,
  87. },
  88. {
  89. Name: "download_rate_mbps",
  90. DisplayName: "Bucket download rate in megabits per second",
  91. Unit: monitor.METRIC_UNIT_MBPS,
  92. },
  93. },
  94. }