mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-01-31 23:41:42 +08:00
Log the memory metrics only once
This commit is contained in:
parent
a9d0f4a002
commit
cb1b7513af
@ -21,6 +21,7 @@ use crate::progress::Progress;
|
|||||||
use crate::update::GrenadParameters;
|
use crate::update::GrenadParameters;
|
||||||
use crate::vector::{ArroyWrapper, EmbeddingConfigs};
|
use crate::vector::{ArroyWrapper, EmbeddingConfigs};
|
||||||
use crate::{FieldsIdsMap, GlobalFieldsIdsMap, Index, InternalError, Result, ThreadPoolNoAbort};
|
use crate::{FieldsIdsMap, GlobalFieldsIdsMap, Index, InternalError, Result, ThreadPoolNoAbort};
|
||||||
|
use std::sync::Once;
|
||||||
|
|
||||||
pub(crate) mod de;
|
pub(crate) mod de;
|
||||||
pub mod document_changes;
|
pub mod document_changes;
|
||||||
@ -33,6 +34,8 @@ mod post_processing;
|
|||||||
mod update_by_function;
|
mod update_by_function;
|
||||||
mod write;
|
mod write;
|
||||||
|
|
||||||
|
static LOG_MEMORY_METRICS_ONCE: Once = Once::new();
|
||||||
|
|
||||||
/// This is the main function of this crate.
|
/// This is the main function of this crate.
|
||||||
///
|
///
|
||||||
/// Give it the output of the [`Indexer::document_changes`] method and it will execute it in the [`rayon::ThreadPool`].
|
/// Give it the output of the [`Indexer::document_changes`] method and it will execute it in the [`rayon::ThreadPool`].
|
||||||
@ -93,12 +96,14 @@ where
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
LOG_MEMORY_METRICS_ONCE.call_once(|| {
|
||||||
tracing::debug!(
|
tracing::debug!(
|
||||||
"Indexation allocated memory metrics - \
|
"Indexation allocated memory metrics - \
|
||||||
Total BBQueue size: {total_bbbuffer_capacity}, \
|
Total BBQueue size: {total_bbbuffer_capacity}, \
|
||||||
Total extractor memory: {:?}",
|
Total extractor memory: {:?}",
|
||||||
grenad_parameters.max_memory,
|
grenad_parameters.max_memory,
|
||||||
);
|
);
|
||||||
|
});
|
||||||
|
|
||||||
let (extractor_sender, writer_receiver) = pool
|
let (extractor_sender, writer_receiver) = pool
|
||||||
.install(|| extractor_writer_bbqueue(&mut bbbuffers, total_bbbuffer_capacity, 1000))
|
.install(|| extractor_writer_bbqueue(&mut bbbuffers, total_bbbuffer_capacity, 1000))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user