mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 03:47:02 +02:00
Added metric to check task queue size until stop
This commit is contained in:
parent
425ef1b205
commit
3d93efc6aa
3 changed files with 19 additions and 1 deletions
|
@ -78,4 +78,10 @@ lazy_static! {
|
|||
"Meilisearch Task Queue Used Size"
|
||||
))
|
||||
.expect("Can't create a metric");
|
||||
pub static ref MEILISEARCH_TASK_QUEUE_SIZE_UNTIL_STOP_REGISTERING: IntGauge =
|
||||
register_int_gauge!(opts!(
|
||||
"meilisearch_task_queue_size_until_stop_registering",
|
||||
"Meilisearch Task Queue Size Until Stop Registering",
|
||||
))
|
||||
.expect("Can't create a metric");
|
||||
}
|
||||
|
|
|
@ -172,6 +172,9 @@ pub async fn get_metrics(
|
|||
crate::metrics::MEILISEARCH_TASK_QUEUE_TOTAL_SIZE.set(index_scheduler.size()? as i64);
|
||||
crate::metrics::MEILISEARCH_TASK_QUEUE_USED_SIZE.set(index_scheduler.used_size()? as i64);
|
||||
|
||||
crate::metrics::MEILISEARCH_TASK_QUEUE_SIZE_UNTIL_STOP_REGISTERING
|
||||
.set(index_scheduler.remaining_size_until_task_queu_stop()? as i64);
|
||||
|
||||
let encoder = TextEncoder::new();
|
||||
let mut buffer = vec![];
|
||||
encoder.encode(&prometheus::gather(), &mut buffer).expect("Failed to encode metrics");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue