mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 04:17:10 +02:00
add a view for the task queue in the metrics
This commit is contained in:
parent
1b601f70c6
commit
c433bdd1cd
4 changed files with 1352 additions and 962 deletions
|
@ -39,6 +39,12 @@ pub async fn get_metrics(
|
|||
.set(value.number_of_documents as i64);
|
||||
}
|
||||
|
||||
for (kind, value) in index_scheduler.get_stats()? {
|
||||
for (value, count) in value {
|
||||
crate::metrics::NB_TASKS.with_label_values(&[&kind, &value]).set(count 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