LCOV - code coverage report
Current view: top level - storage_broker/src - metrics.rs (source / functions) Coverage Total Hit
Test: 2b0730d767f560e20b6748f57465922aa8bb805e.info Lines: 54.3 % 46 25
Test Date: 2024-09-25 14:04:07 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            1 : pub static NUM_PUBS: Lazy<IntGauge> = Lazy::new(|| {
       7            1 :     register_int_gauge!("storage_broker_active_publishers", "Number of publications")
       8            1 :         .expect("Failed to register metric")
       9            1 : });
      10              : 
      11            1 : pub static NUM_SUBS_TIMELINE: Lazy<IntGauge> = Lazy::new(|| {
      12            1 :     register_int_gauge!(
      13            1 :         "storage_broker_per_timeline_active_subscribers",
      14            1 :         "Number of subsciptions to particular tenant timeline id"
      15            1 :     )
      16            1 :     .expect("Failed to register metric")
      17            1 : });
      18              : 
      19            1 : pub static NUM_SUBS_ALL: Lazy<IntGauge> = Lazy::new(|| {
      20            1 :     register_int_gauge!(
      21            1 :         "storage_broker_all_keys_active_subscribers",
      22            1 :         "Number of subsciptions to all keys"
      23            1 :     )
      24            1 :     .expect("Failed to register metric")
      25            1 : });
      26              : 
      27            1 : pub static PROCESSED_MESSAGES_TOTAL: Lazy<IntCounter> = Lazy::new(|| {
      28            1 :     register_int_counter!(
      29            1 :         "storage_broker_processed_messages_total",
      30            1 :         "Number of messages received by storage broker, before routing and broadcasting"
      31            1 :     )
      32            1 :     .expect("Failed to register metric")
      33            1 : });
      34              : 
      35            0 : pub static BROADCASTED_MESSAGES_TOTAL: Lazy<IntCounter> = Lazy::new(|| {
      36            0 :     register_int_counter!(
      37            0 :         "storage_broker_broadcasted_messages_total",
      38            0 :         "Number of messages broadcasted (sent over network) to subscribers"
      39            0 :     )
      40            0 :     .expect("Failed to register metric")
      41            0 : });
      42              : 
      43            0 : pub static BROADCAST_DROPPED_MESSAGES_TOTAL: Lazy<IntCounter> = Lazy::new(|| {
      44            0 :     register_int_counter!(
      45            0 :         "storage_broker_broadcast_dropped_messages_total",
      46            0 :         "Number of messages dropped due to channel capacity overflow"
      47            0 :     )
      48            0 :     .expect("Failed to register metric")
      49            0 : });
      50              : 
      51            0 : pub static PUBLISHED_ONEOFF_MESSAGES_TOTAL: Lazy<IntCounter> = Lazy::new(|| {
      52            0 :     register_int_counter!(
      53            0 :         "storage_broker_published_oneoff_messages_total",
      54            0 :         "Number of one-off messages sent via PublishOne method"
      55            0 :     )
      56            0 :     .expect("Failed to register metric")
      57            0 : });
        

Generated by: LCOV version 2.1-beta