From 0784e8dddccdfaaab62a0b840ebea340de8fb106 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Thu, 19 Dec 2024 10:41:50 +0100 Subject: [PATCH] Add more spans to debug compression --- .../milli/src/update/new/extract/documents/compression.rs | 1 + crates/milli/src/update/new/extract/documents/mod.rs | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/crates/milli/src/update/new/extract/documents/compression.rs b/crates/milli/src/update/new/extract/documents/compression.rs index 1e99b6e13..db64c01c9 100644 --- a/crates/milli/src/update/new/extract/documents/compression.rs +++ b/crates/milli/src/update/new/extract/documents/compression.rs @@ -45,6 +45,7 @@ const TEN_KIB: usize = 10 * 1024; /// If there are too many documents already in the database and no /// compression dictionary we prefer not to generate a dictionary to avoid /// compressing all of the documents and potentially blow up disk space. +#[tracing::instrument(level = "trace", skip_all, target = "indexing::documents")] pub fn retrieve_or_compute_document_compression_dictionary<'pl, 'extractor, DC, MSP>( index: &Index, wtxn: &mut RwTxn<'_>, diff --git a/crates/milli/src/update/new/extract/documents/mod.rs b/crates/milli/src/update/new/extract/documents/mod.rs index 5c1abcb89..b375503b4 100644 --- a/crates/milli/src/update/new/extract/documents/mod.rs +++ b/crates/milli/src/update/new/extract/documents/mod.rs @@ -153,6 +153,10 @@ impl<'a, 'b, 'extractor> Extractor<'extractor> for DocumentsExtractor<'a, 'b> { match document_extractor_data.documents_compressor.as_mut() { Some(compressor) => { + let span = + tracing::trace_span!(target: "indexing::documents", "compress"); + let _entered = span.enter(); + let doc = CompressedObkvU16::with_compressor(content, compressor)?; self.document_sender .write_compressed(docid, external_docid, &doc) @@ -188,6 +192,10 @@ impl<'a, 'b, 'extractor> Extractor<'extractor> for DocumentsExtractor<'a, 'b> { document_extractor_data.docids_delta.insert_add_u32(docid); match document_extractor_data.documents_compressor.as_mut() { Some(compressor) => { + let span = + tracing::trace_span!(target: "indexing::documents", "compress"); + let _entered = span.enter(); + let doc = CompressedObkvU16::with_compressor(content, compressor)?; self.document_sender .write_compressed(docid, external_docid, &doc)