emqx_bridge.hrl 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. %%--------------------------------------------------------------------
  2. %% Copyright (c) 2020-2023 EMQ Technologies Co., Ltd. All Rights Reserved.
  3. %%
  4. %% Licensed under the Apache License, Version 2.0 (the "License");
  5. %% you may not use this file except in compliance with the License.
  6. %% You may obtain a copy of the License at
  7. %%
  8. %% http://www.apache.org/licenses/LICENSE-2.0
  9. %%
  10. %% Unless required by applicable law or agreed to in writing, software
  11. %% distributed under the License is distributed on an "AS IS" BASIS,
  12. %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. %% See the License for the specific language governing permissions and
  14. %% limitations under the License.
  15. %%--------------------------------------------------------------------
  16. -define(EMPTY_METRICS,
  17. ?METRICS(
  18. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  19. )
  20. ).
  21. -define(METRICS(
  22. Dropped,
  23. DroppedOther,
  24. DroppedExpired,
  25. DroppedQueueFull,
  26. DroppedResourceNotFound,
  27. DroppedResourceStopped,
  28. Matched,
  29. Queued,
  30. Retried,
  31. LateReply,
  32. SentFailed,
  33. SentInflight,
  34. SentSucc,
  35. RATE,
  36. RATE_5,
  37. RATE_MAX,
  38. Rcvd
  39. ),
  40. #{
  41. 'dropped' => Dropped,
  42. 'dropped.other' => DroppedOther,
  43. 'dropped.expired' => DroppedExpired,
  44. 'dropped.queue_full' => DroppedQueueFull,
  45. 'dropped.resource_not_found' => DroppedResourceNotFound,
  46. 'dropped.resource_stopped' => DroppedResourceStopped,
  47. 'matched' => Matched,
  48. 'queuing' => Queued,
  49. 'retried' => Retried,
  50. 'late_reply' => LateReply,
  51. 'failed' => SentFailed,
  52. 'inflight' => SentInflight,
  53. 'success' => SentSucc,
  54. rate => RATE,
  55. rate_last5m => RATE_5,
  56. rate_max => RATE_MAX,
  57. received => Rcvd
  58. }
  59. ).
  60. -define(metrics(
  61. Dropped,
  62. DroppedOther,
  63. DroppedExpired,
  64. DroppedQueueFull,
  65. DroppedResourceNotFound,
  66. DroppedResourceStopped,
  67. Matched,
  68. Queued,
  69. Retried,
  70. LateReply,
  71. SentFailed,
  72. SentInflight,
  73. SentSucc,
  74. RATE,
  75. RATE_5,
  76. RATE_MAX,
  77. Rcvd
  78. ),
  79. #{
  80. 'dropped' := Dropped,
  81. 'dropped.other' := DroppedOther,
  82. 'dropped.expired' := DroppedExpired,
  83. 'dropped.queue_full' := DroppedQueueFull,
  84. 'dropped.resource_not_found' := DroppedResourceNotFound,
  85. 'dropped.resource_stopped' := DroppedResourceStopped,
  86. 'matched' := Matched,
  87. 'queuing' := Queued,
  88. 'retried' := Retried,
  89. 'late_reply' := LateReply,
  90. 'failed' := SentFailed,
  91. 'inflight' := SentInflight,
  92. 'success' := SentSucc,
  93. rate := RATE,
  94. rate_last5m := RATE_5,
  95. rate_max := RATE_MAX,
  96. received := Rcvd
  97. }
  98. ).