penumbra_sdk_view/
metrics.rs

1//! Crate-specific metrics functionality.
2//!
3//! This module re-exports the contents of the `metrics` crate.  This is
4//! effectively a way to monkey-patch the functions in this module into the
5//! `metrics` crate, at least from the point of view of the other code in this
6//! crate.
7//!
8//! Code in this crate that wants to use metrics should `use crate::metrics;`,
9//! so that this module shadows the `metrics` crate.
10//!
11//! This trick is probably good to avoid in general, because it could be
12//! confusing, but in this limited case, it seems like a clean option.
13
14#[allow(unused_imports)]
15pub use metrics::*;
16
17/// Registers all metrics used by this crate.
18pub fn register_metrics() {
19    /*
20    // Sample code for reference -- delete when adding the first metric
21    register_counter!(MEMPOOL_CHECKTX_TOTAL);
22    describe_counter!(
23        MEMPOOL_CHECKTX_TOTAL,
24        "The total number of checktx requests made to the mempool"
25    );
26     */
27}
28
29// Sample code for reference -- delete when adding the first metric
30// pub const MEMPOOL_CHECKTX_TOTAL: &str = "penumbra_pd_mempool_checktx_total";