()
| 6 | use crate::metric_names::*; |
| 7 | |
| 8 | pub(crate) fn init() -> PrometheusHandle { |
| 9 | metrics::describe_histogram!( |
| 10 | HISTOGRAM_HTTP_REQUEST_DURATION, |
| 11 | Unit::Seconds, |
| 12 | "Duration (in seconds) a request took to be processed" |
| 13 | ); |
| 14 | |
| 15 | PrometheusBuilder::new() |
| 16 | .set_buckets_for_metric( |
| 17 | metrics_exporter_prometheus::Matcher::Full(HISTOGRAM_HTTP_REQUEST_DURATION.to_owned()), |
| 18 | &exp_buckets::<28>(0.001), // values from ~0.3ms -> ~33s |
| 19 | ) |
| 20 | .unwrap() |
| 21 | .install_recorder() |
| 22 | .unwrap() |
| 23 | } |
| 24 | |
| 25 | fn exp_buckets<const N: usize>(base: f64) -> [f64; N] { |
| 26 | const RATIO: f64 = 1.5; |
nothing calls this directly
no outgoing calls
no test coverage detected