mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-01 17:15:46 +01:00
increase the bucketing of requests
This commit is contained in:
parent
57d53de402
commit
1b601f70c6
@ -5,18 +5,18 @@ use prometheus::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// Create evenly distributed buckets
|
/// Create evenly distributed buckets
|
||||||
fn create_buckets<const N: usize>() -> [f64; N] {
|
fn create_buckets() -> [f64; 29] {
|
||||||
let mut array = [0.0; N];
|
(0..10)
|
||||||
|
.chain((10..100).step_by(10))
|
||||||
for i in 0..N {
|
.chain((100..=1000).step_by(100))
|
||||||
array[i] = ((i + 1) as f64) / N as f64;
|
.map(|i| i as f64 / 1000.)
|
||||||
}
|
.collect::<Vec<_>>()
|
||||||
|
.try_into()
|
||||||
array
|
.unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
pub static ref HTTP_RESPONSE_TIME_CUSTOM_BUCKETS: [f64; 100] = create_buckets();
|
pub static ref HTTP_RESPONSE_TIME_CUSTOM_BUCKETS: [f64; 29] = create_buckets();
|
||||||
pub static ref HTTP_REQUESTS_TOTAL: IntCounterVec = register_int_counter_vec!(
|
pub static ref HTTP_REQUESTS_TOTAL: IntCounterVec = register_int_counter_vec!(
|
||||||
opts!("http_requests_total", "HTTP requests total"),
|
opts!("http_requests_total", "HTTP requests total"),
|
||||||
&["method", "path"]
|
&["method", "path"]
|
||||||
|
Loading…
Reference in New Issue
Block a user