LCOV - code coverage report
Current view: top level - storage_broker/src - metrics.rs (source / functions) Coverage Total Hit
Test: 32f4a56327bc9da697706839ed4836b2a00a408f.info Lines: 69.6 % 46 32
Test Date: 2024-02-07 07:37:29 Functions: 71.4 % 14 10

            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            3 : pub static NUM_PUBS: Lazy<IntGauge> = Lazy::new(|| {
       7            3 :     register_int_gauge!("storage_broker_active_publishers", "Number of publications")
       8            3 :         .expect("Failed to register metric")
       9            3 : });
      10              : 
      11            3 : pub static NUM_SUBS_TIMELINE: Lazy<IntGauge> = Lazy::new(|| {
      12            3 :     register_int_gauge!(
      13            3 :         "storage_broker_per_timeline_active_subscribers",
      14            3 :         "Number of subsciptions to particular tenant timeline id"
      15            3 :     )
      16            3 :     .expect("Failed to register metric")
      17            3 : });
      18              : 
      19            3 : pub static NUM_SUBS_ALL: Lazy<IntGauge> = Lazy::new(|| {
      20            3 :     register_int_gauge!(
      21            3 :         "storage_broker_all_keys_active_subscribers",
      22            3 :         "Number of subsciptions to all keys"
      23            3 :     )
      24            3 :     .expect("Failed to register metric")
      25            3 : });
      26              : 
      27            3 : pub static PROCESSED_MESSAGES_TOTAL: Lazy<IntCounter> = Lazy::new(|| {
      28            3 :     register_int_counter!(
      29            3 :         "storage_broker_processed_messages_total",
      30            3 :         "Number of messages received by storage broker, before routing and broadcasting"
      31            3 :     )
      32            3 :     .expect("Failed to register metric")
      33            3 : });
      34              : 
      35            1 : pub static BROADCASTED_MESSAGES_TOTAL: Lazy<IntCounter> = Lazy::new(|| {
      36            1 :     register_int_counter!(
      37            1 :         "storage_broker_broadcasted_messages_total",
      38            1 :         "Number of messages broadcasted (sent over network) to subscribers"
      39            1 :     )
      40            1 :     .expect("Failed to register metric")
      41            1 : });
      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