From cf760cbfb16cce3fe3461cfa88d4d2e2f8889f9b Mon Sep 17 00:00:00 2001 From: Tamo Date: Wed, 17 Jul 2024 11:56:57 +0200 Subject: [PATCH] Log the time to index a batch of task --- index-scheduler/src/batch.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index-scheduler/src/batch.rs b/index-scheduler/src/batch.rs index d504ef915..3e6e78614 100644 --- a/index-scheduler/src/batch.rs +++ b/index-scheduler/src/batch.rs @@ -1281,6 +1281,7 @@ impl IndexScheduler { operations, mut tasks, } => { + let started_processing_at = std::time::Instant::now(); let mut primary_key_has_been_set = false; let must_stop_processing = self.must_stop_processing.clone(); let indexer_config = self.index_mapper.indexer_config(); @@ -1395,7 +1396,7 @@ impl IndexScheduler { if !tasks.iter().all(|res| res.error.is_some()) { let addition = builder.execute()?; - tracing::info!(indexing_result = ?addition, "document indexing done"); + tracing::info!(indexing_result = ?addition, processed_in = ?started_processing_at.elapsed(), "document indexing done"); } else if primary_key_has_been_set { // Everything failed but we've set a primary key. // We need to remove it.