LCOV - code coverage report
Current view: top level - storage_broker/src - metrics.rs (source / functions) Coverage Total Hit
Test: 02e8c57acd6e2b986849f552ca30280d54699b79.info Lines: 57.1 % 21 12
Test Date: 2024-06-26 17:13:54 Functions: 57.1 % 7 4

            Line data    Source code
       1              : //! Broker metrics.
       2              : 
       3              : use metrics::{register_int_counter, register_int_gauge, IntCounter, IntGauge};
       4              : use once_cell::sync::Lazy;
       5              : 
       6            2 : pub static NUM_PUBS: Lazy<IntGauge> = Lazy::new(|| {
       7              :     register_int_gauge!("storage_broker_active_publishers", "Number of publications")
       8            2 :         .expect("Failed to register metric")
       9            2 : });
      10              : 
      11            2 : pub static NUM_SUBS_TIMELINE: Lazy<IntGauge> = Lazy::new(|| {
      12              :     register_int_gauge!(
      13              :         "storage_broker_per_timeline_active_subscribers",
      14              :         "Number of subsciptions to particular tenant timeline id"
      15              :     )
      16            2 :     .expect("Failed to register metric")
      17            2 : });
      18              : 
      19            2 : pub static NUM_SUBS_ALL: Lazy<IntGauge> = Lazy::new(|| {
      20              :     register_int_gauge!(
      21              :         "storage_broker_all_keys_active_subscribers",
      22              :         "Number of subsciptions to all keys"
      23              :     )
      24            2 :     .expect("Failed to register metric")
      25            2 : });
      26              : 
      27            2 : pub static PROCESSED_MESSAGES_TOTAL: Lazy<IntCounter> = Lazy::new(|| {
      28              :     register_int_counter!(
      29              :         "storage_broker_processed_messages_total",
      30              :         "Number of messages received by storage broker, before routing and broadcasting"
      31              :     )
      32            2 :     .expect("Failed to register metric")
      33            2 : });
      34              : 
      35            0 : pub static BROADCASTED_MESSAGES_TOTAL: Lazy<IntCounter> = Lazy::new(|| {
      36              :     register_int_counter!(
      37              :         "storage_broker_broadcasted_messages_total",
      38              :         "Number of messages broadcasted (sent over network) to subscribers"
      39              :     )
      40            0 :     .expect("Failed to register metric")
      41            0 : });
      42              : 
      43            0 : pub static BROADCAST_DROPPED_MESSAGES_TOTAL: Lazy<IntCounter> = Lazy::new(|| {
      44              :     register_int_counter!(
      45              :         "storage_broker_broadcast_dropped_messages_total",
      46              :         "Number of messages dropped due to channel capacity overflow"
      47              :     )
      48            0 :     .expect("Failed to register metric")
      49            0 : });
      50              : 
      51            0 : pub static PUBLISHED_ONEOFF_MESSAGES_TOTAL: Lazy<IntCounter> = Lazy::new(|| {
      52              :     register_int_counter!(
      53              :         "storage_broker_published_oneoff_messages_total",
      54              :         "Number of one-off messages sent via PublishOne method"
      55              :     )
      56            0 :     .expect("Failed to register metric")
      57            0 : });
        

Generated by: LCOV version 2.1-beta