Skip to content
Snippets Groups Projects
Commit 4c280059 authored by Niklas Adolfsson's avatar Niklas Adolfsson Committed by GitHub
Browse files

feat(rpc middleware): use custom time buckets (#11950)

* feat(rpc middleware): use custom time buckets

* cargo fmt

* make it compile again

* fix bad comment
parent 18773590
No related merge requests found
......@@ -25,6 +25,21 @@ use prometheus_endpoint::{
};
use std::net::SocketAddr;
/// Histogram time buckets in microseconds.
const HISTOGRAM_BUCKETS: [f64; 11] = [
5.0,
25.0,
100.0,
500.0,
1_000.0,
2_500.0,
10_000.0,
25_000.0,
100_000.0,
1_000_000.0,
10_000_000.0,
];
/// Metrics for RPC middleware storing information about the number of requests started/completed,
/// calls started/completed and their timings.
#[derive(Debug, Clone)]
......@@ -75,7 +90,8 @@ impl RpcMetrics {
HistogramOpts::new(
"substrate_rpc_calls_time",
"Total time [μs] of processed RPC calls",
),
)
.buckets(HISTOGRAM_BUCKETS.to_vec()),
&["protocol", "method"],
)?,
metrics_registry,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment