emqx_ds_metrics.hrl 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. %%--------------------------------------------------------------------
  2. %% Copyright (c) 2023-2024 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. -ifndef(EMQX_DS_METRICS_HRL).
  17. -define(EMQX_DS_METRICS_HRL, true).
  18. %%%% Egress metrics:
  19. %% Number of successfully flushed batches:
  20. -define(DS_EGRESS_BATCHES, emqx_ds_egress_batches).
  21. %% Number of batch flush retries:
  22. -define(DS_EGRESS_BATCHES_RETRY, emqx_ds_egress_batches_retry).
  23. %% Number of batches that weren't flushed due to unrecoverable errors:
  24. -define(DS_EGRESS_BATCHES_FAILED, emqx_ds_egress_batches_failed).
  25. %% Total number of messages that were successfully committed to the storage:
  26. -define(DS_EGRESS_MESSAGES, emqx_ds_egress_messages).
  27. %% Total size of payloads that were successfully committed to the storage:
  28. -define(DS_EGRESS_BYTES, emqx_ds_egress_bytes).
  29. %% Sliding average of flush time (microseconds):
  30. -define(DS_EGRESS_FLUSH_TIME, emqx_ds_egress_flush_time).
  31. %%%% Storage layer metrics:
  32. -define(DS_STORE_BATCH_TIME, emqx_ds_store_batch_time).
  33. -define(DS_BUILTIN_NEXT_TIME, emqx_ds_builtin_next_time).
  34. %%% LTS Storage counters:
  35. %% This counter is incremented when the iterator seeks to the next interval:
  36. -define(DS_LTS_SEEK_COUNTER, emqx_ds_storage_bitfield_lts_counter_seek).
  37. %% This counter is incremented when the iterator proceeds to the next
  38. %% key within the interval (this is is best case scenario):
  39. -define(DS_LTS_NEXT_COUNTER, emqx_ds_storage_bitfield_lts_counter_next).
  40. %% This counter is incremented when the key passes bitmask check, but
  41. %% the value is rejected by the subsequent post-processing:
  42. -define(DS_LTS_COLLISION_COUNTER, emqx_ds_storage_bitfield_lts_counter_collision).
  43. -endif.