richat-shared 8.0.1

Richat Shared code
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use metrics::{describe_counter, describe_histogram};

pub const RPC_REQUESTS_TOTAL: &str = "rpc_requests_total"; // x_subscription_id, method
pub const RPC_REQUESTS_DURATION_SECONDS: &str = "rpc_requests_duration_seconds"; // x_subscription_id, method
pub const RPC_REQUESTS_GENERATED_BYTES_TOTAL: &str = "rpc_requests_generated_bytes_total"; // x_subscription_id

#[rustfmt::skip]
pub fn describe() {
    describe_counter!(RPC_REQUESTS_TOTAL, "Number of RPC requests by x-subscription-id and method");
    describe_histogram!(RPC_REQUESTS_DURATION_SECONDS, "RPC request time by x-subscription-id and method");
    describe_counter!(RPC_REQUESTS_GENERATED_BYTES_TOTAL, "Number of bytes generated by RPC requests by x-subscription-id");
}