mirror of
				https://github.com/meilisearch/meilisearch.git
				synced 2025-10-30 23:46:28 +00:00 
			
		
		
		
	Add logging timers
This commit is contained in:
		| @@ -57,6 +57,7 @@ impl<'t, 'u, 'i> Facets<'t, 'u, 'i> { | ||||
|         self | ||||
|     } | ||||
|  | ||||
|     #[logging_timer::time("Facets::{}")] | ||||
|     pub fn execute(self) -> Result<()> { | ||||
|         self.index.set_updated_at(self.wtxn, &Utc::now())?; | ||||
|         // We get the faceted fields to be able to create the facet levels. | ||||
|   | ||||
| @@ -17,6 +17,7 @@ use crate::{FieldId, Result}; | ||||
| /// | ||||
| /// Returns the generated internal documents ids and a grenad reader | ||||
| /// with the list of extracted words from the given chunk of documents. | ||||
| #[logging_timer::time] | ||||
| pub fn extract_docid_word_positions<R: io::Read>( | ||||
|     mut obkv_documents: grenad::Reader<R>, | ||||
|     indexer: GrenadParameters, | ||||
|   | ||||
| @@ -13,6 +13,7 @@ use crate::Result; | ||||
| /// | ||||
| /// Returns a grenad reader with the list of extracted facet numbers and | ||||
| /// documents ids from the given chunk of docid facet number positions. | ||||
| #[logging_timer::time] | ||||
| pub fn extract_facet_number_docids<R: io::Read>( | ||||
|     mut docid_fid_facet_number: grenad::Reader<R>, | ||||
|     indexer: GrenadParameters, | ||||
|   | ||||
| @@ -15,6 +15,7 @@ use crate::{FieldId, Result}; | ||||
| /// | ||||
| /// Returns a grenad reader with the list of extracted facet strings and | ||||
| /// documents ids from the given chunk of docid facet string positions. | ||||
| #[logging_timer::time] | ||||
| pub fn extract_facet_string_docids<R: io::Read>( | ||||
|     mut docid_fid_facet_string: grenad::Reader<R>, | ||||
|     indexer: GrenadParameters, | ||||
|   | ||||
| @@ -15,6 +15,7 @@ use crate::{DocumentId, FieldId, Result}; | ||||
| /// | ||||
| /// Returns the generated grenad reader containing the docid the fid and the orginal value as key | ||||
| /// and the normalized value as value extracted from the given chunk of documents. | ||||
| #[logging_timer::time] | ||||
| pub fn extract_fid_docid_facet_values<R: io::Read>( | ||||
|     mut obkv_documents: grenad::Reader<R>, | ||||
|     indexer: GrenadParameters, | ||||
|   | ||||
| @@ -16,6 +16,7 @@ use crate::{DocumentId, FieldId, Result}; | ||||
| /// | ||||
| /// Returns a grenad reader with the list of extracted field id word counts | ||||
| /// and documents ids from the given chunk of docid word positions. | ||||
| #[logging_timer::time] | ||||
| pub fn extract_fid_word_count_docids<R: io::Read>( | ||||
|     mut docid_word_positions: grenad::Reader<R>, | ||||
|     indexer: GrenadParameters, | ||||
|   | ||||
| @@ -14,6 +14,7 @@ use crate::Result; | ||||
| /// | ||||
| /// Returns a grenad reader with the list of extracted words and | ||||
| /// documents ids from the given chunk of docid word positions. | ||||
| #[logging_timer::time] | ||||
| pub fn extract_word_docids<R: io::Read>( | ||||
|     mut docid_word_positions: grenad::Reader<R>, | ||||
|     indexer: GrenadParameters, | ||||
|   | ||||
| @@ -10,6 +10,7 @@ use crate::{DocumentId, Result}; | ||||
| /// | ||||
| /// Returns a grenad reader with the list of extracted words at positions and | ||||
| /// documents ids from the given chunk of docid word positions. | ||||
| #[logging_timer::time] | ||||
| pub fn extract_word_level_position_docids<R: io::Read>( | ||||
|     mut docid_word_positions: grenad::Reader<R>, | ||||
|     indexer: GrenadParameters, | ||||
|   | ||||
| @@ -17,6 +17,7 @@ use crate::{DocumentId, Result}; | ||||
| /// | ||||
| /// Returns a grenad reader with the list of extracted word pairs proximities and | ||||
| /// documents ids from the given chunk of docid word positions. | ||||
| #[logging_timer::time] | ||||
| pub fn extract_word_pair_proximity_docids<R: io::Read>( | ||||
|     mut docid_word_positions: grenad::Reader<R>, | ||||
|     indexer: GrenadParameters, | ||||
|   | ||||
| @@ -136,6 +136,7 @@ impl<'t, 'u, 'i, 'a> IndexDocuments<'t, 'u, 'i, 'a> { | ||||
|         self.autogenerate_docids = false; | ||||
|     } | ||||
|  | ||||
|     #[logging_timer::time("IndexDocuments::{}")] | ||||
|     pub fn execute<R, F>(self, reader: R, progress_callback: F) -> Result<DocumentAdditionResult> | ||||
|     where | ||||
|         R: io::Read, | ||||
| @@ -181,6 +182,7 @@ impl<'t, 'u, 'i, 'a> IndexDocuments<'t, 'u, 'i, 'a> { | ||||
|         Ok(DocumentAdditionResult { nb_documents }) | ||||
|     } | ||||
|  | ||||
|     #[logging_timer::time("IndexDocuments::{}")] | ||||
|     pub fn execute_raw<F>(self, output: TransformOutput, progress_callback: F) -> Result<()> | ||||
|     where | ||||
|         F: Fn(UpdateIndexingStep) + Sync, | ||||
| @@ -341,6 +343,7 @@ impl<'t, 'u, 'i, 'a> IndexDocuments<'t, 'u, 'i, 'a> { | ||||
|         self.execute_prefix_databases(progress_callback) | ||||
|     } | ||||
|  | ||||
|     #[logging_timer::time("IndexDocuments::{}")] | ||||
|     pub fn execute_prefix_databases<F>(self, progress_callback: F) -> Result<()> | ||||
|     where | ||||
|         F: Fn(UpdateIndexingStep) + Sync, | ||||
|   | ||||
| @@ -33,6 +33,7 @@ impl<'t, 'u, 'i> WordPrefixDocids<'t, 'u, 'i> { | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     #[logging_timer::time("WordPrefixDocids::{}")] | ||||
|     pub fn execute(self) -> Result<()> { | ||||
|         // Clear the word prefix docids database. | ||||
|         self.index.word_prefix_docids.clear(self.wtxn)?; | ||||
|   | ||||
| @@ -48,6 +48,7 @@ impl<'t, 'u, 'i> WordPrefixPairProximityDocids<'t, 'u, 'i> { | ||||
|         self | ||||
|     } | ||||
|  | ||||
|     #[logging_timer::time("WordPrefixPairProximityDocids::{}")] | ||||
|     pub fn execute(self) -> Result<()> { | ||||
|         debug!("Computing and writing the word prefix pair proximity docids into LMDB on disk..."); | ||||
|  | ||||
|   | ||||
| @@ -57,6 +57,7 @@ impl<'t, 'u, 'i> WordsLevelPositions<'t, 'u, 'i> { | ||||
|         self | ||||
|     } | ||||
|  | ||||
|     #[logging_timer::time("WordsLevelPositions::{}")] | ||||
|     pub fn execute(self) -> Result<()> { | ||||
|         debug!("Computing and writing the word levels positions docids into LMDB on disk..."); | ||||
|  | ||||
|   | ||||
| @@ -48,6 +48,7 @@ impl<'t, 'u, 'i> WordsPrefixesFst<'t, 'u, 'i> { | ||||
|         self | ||||
|     } | ||||
|  | ||||
|     #[logging_timer::time("WordsPrefixesFst::{}")] | ||||
|     pub fn execute(self) -> Result<()> { | ||||
|         let words_fst = self.index.words_fst(&self.wtxn)?; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user