mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Expose lastUpdate and isIndexing in /stats endpoint
This commit is contained in:
parent
28404d56b7
commit
6d4981ec25
3 changed files with 37 additions and 0 deletions
|
@ -48,6 +48,9 @@ pub async fn get_metrics(
|
|||
}
|
||||
}
|
||||
|
||||
crate::metrics::MEILISEARCH_LAST_UPDATE.set(response.last_update.unwrap().unix_timestamp() as i64);
|
||||
crate::metrics::MEILISEARCH_IS_INDEXING.set(index_scheduler.is_task_processing().unwrap() 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