service_http_code.go 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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 serviceHttpCode = SMeasurement{
  17. Context: []SMonitorContext{
  18. {
  19. "http_request", "HTTP Request hit",
  20. monitor.METRIC_RES_TYPE_SYSTEM, monitor.METRIC_DATABASE_SYSTEM,
  21. },
  22. },
  23. Metrics: []SMetric{
  24. {
  25. Name: "duration_ms_any",
  26. DisplayName: "Accumulated request duration in milliseconds",
  27. Unit: monitor.METRIC_UNIT_MS,
  28. },
  29. {
  30. Name: "dura_ms_delta_any",
  31. DisplayName: "Accumulated request duration in milliseconds in last interval",
  32. Unit: monitor.METRIC_UNIT_MS,
  33. },
  34. {
  35. Name: "hit_any",
  36. DisplayName: "Accumulated request count",
  37. Unit: monitor.METRIC_UNIT_NULL,
  38. },
  39. {
  40. Name: "hit_delta_any",
  41. DisplayName: "Accumulated request count in last interval",
  42. Unit: monitor.METRIC_UNIT_NULL,
  43. },
  44. {
  45. Name: "delay_ms_any",
  46. DisplayName: "Average request delay in miilliseconds",
  47. Unit: monitor.METRIC_UNIT_MS,
  48. },
  49. {
  50. Name: "qps_any",
  51. DisplayName: "Averatge request per second",
  52. Unit: monitor.METRIC_UNIT_NULL,
  53. },
  54. {
  55. Name: "duration_ms_2xx",
  56. DisplayName: "Accumulated request duration in milliseconds for 2xx http code",
  57. Unit: monitor.METRIC_UNIT_MS,
  58. },
  59. {
  60. Name: "dura_ms_delta_2xx",
  61. DisplayName: "Accumulated request duration in milliseconds in last interval for 2xx http code",
  62. Unit: monitor.METRIC_UNIT_MS,
  63. },
  64. {
  65. Name: "hit_2xx",
  66. DisplayName: "Accumulated request count for 2xx http code",
  67. Unit: monitor.METRIC_UNIT_NULL,
  68. },
  69. {
  70. Name: "hit_delta_2xx",
  71. DisplayName: "Accumulated request count in last interval for 2xx http code",
  72. Unit: monitor.METRIC_UNIT_NULL,
  73. },
  74. {
  75. Name: "delay_ms_2xx",
  76. DisplayName: "Average request delay in miilliseconds for 2xx http code",
  77. Unit: monitor.METRIC_UNIT_MS,
  78. },
  79. {
  80. Name: "percent_hit_2xx",
  81. DisplayName: "Request hit weight in percentage for 2xx http code",
  82. Unit: monitor.METRIC_UNIT_PERCENT,
  83. },
  84. {
  85. Name: "percent_duration_2xx",
  86. DisplayName: "Request duration weight in percentage for 2xx http code",
  87. Unit: monitor.METRIC_UNIT_PERCENT,
  88. },
  89. {
  90. Name: "qps_2xx",
  91. DisplayName: "Averatge request per second for 2xx http code",
  92. Unit: monitor.METRIC_UNIT_NULL,
  93. },
  94. {
  95. Name: "duration_ms_4xx",
  96. DisplayName: "Accumulated request duration in milliseconds for 4xx http code",
  97. Unit: monitor.METRIC_UNIT_MS,
  98. },
  99. {
  100. Name: "dura_ms_delta_4xx",
  101. DisplayName: "Accumulated request duration in milliseconds in last interval for 4xx http code",
  102. Unit: monitor.METRIC_UNIT_MS,
  103. },
  104. {
  105. Name: "hit_4xx",
  106. DisplayName: "Accumulated request count for 4xx http code",
  107. Unit: monitor.METRIC_UNIT_NULL,
  108. },
  109. {
  110. Name: "hit_delta_4xx",
  111. DisplayName: "Accumulated request count in last interval for 4xx http code",
  112. Unit: monitor.METRIC_UNIT_NULL,
  113. },
  114. {
  115. Name: "delay_ms_4xx",
  116. DisplayName: "Average request delay in miilliseconds for 4xx http code",
  117. Unit: monitor.METRIC_UNIT_MS,
  118. },
  119. {
  120. Name: "percent_hit_4xx",
  121. DisplayName: "Request hit weight in percentage for 4xx http code",
  122. Unit: monitor.METRIC_UNIT_PERCENT,
  123. },
  124. {
  125. Name: "percent_duration_4xx",
  126. DisplayName: "Request duration weight in percentage for 4xx http code",
  127. Unit: monitor.METRIC_UNIT_PERCENT,
  128. },
  129. {
  130. Name: "qps_4xx",
  131. DisplayName: "Averatge request per second for 4xx http code",
  132. Unit: monitor.METRIC_UNIT_NULL,
  133. },
  134. {
  135. Name: "duration_ms_5xx",
  136. DisplayName: "Accumulated request duration in milliseconds for 5xx http code",
  137. Unit: monitor.METRIC_UNIT_MS,
  138. },
  139. {
  140. Name: "dura_ms_delta_5xx",
  141. DisplayName: "Accumulated request duration in milliseconds in last interval for 5xx http code",
  142. Unit: monitor.METRIC_UNIT_MS,
  143. },
  144. {
  145. Name: "hit_5xx",
  146. DisplayName: "Accumulated request count for 5xx http code",
  147. Unit: monitor.METRIC_UNIT_NULL,
  148. },
  149. {
  150. Name: "hit_delta_5xx",
  151. DisplayName: "Accumulated request count in last interval for 5xx http code",
  152. Unit: monitor.METRIC_UNIT_NULL,
  153. },
  154. {
  155. Name: "delay_ms_5xx",
  156. DisplayName: "Average request delay in miilliseconds for 5xx http code",
  157. Unit: monitor.METRIC_UNIT_MS,
  158. },
  159. {
  160. Name: "percent_hit_5xx",
  161. DisplayName: "Request hit weight in percentage for 5xx http code",
  162. Unit: monitor.METRIC_UNIT_PERCENT,
  163. },
  164. {
  165. Name: "percent_duration_5xx",
  166. DisplayName: "Request duration weight in percentage for 5xx http code",
  167. Unit: monitor.METRIC_UNIT_PERCENT,
  168. },
  169. {
  170. Name: "qps_5xx",
  171. DisplayName: "Averatge request per second for 5xx http code",
  172. Unit: monitor.METRIC_UNIT_NULL,
  173. },
  174. },
  175. }