File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,7 @@ pub use self::{
150150use crate :: {
151151 aggregation:: TokenMatchAggregator ,
152152 constants:: MAX_UNIQUE_QUERY_TERMS ,
153+ metrics:: log_num_segments_searched_total,
153154 ranking:: Ranker ,
154155 searcher:: {
155156 Bm25Stats ,
@@ -446,6 +447,8 @@ impl TantivySearchIndexSchema {
446447 disk_index_ts : Timestamp ,
447448 searcher : Arc < dyn Searcher > ,
448449 ) -> anyhow:: Result < RevisionWithKeys > {
450+ log_num_segments_searched_total ( segments. len ( ) ) ;
451+
449452 // Step 1: Map the old `CompiledQuery` struct onto `TokenQuery`s.
450453 let mut token_queries = vec ! [ ] ;
451454 let num_text_query_terms = compiled_query. text_query . len ( ) as u32 ;
Original file line number Diff line number Diff line change @@ -580,3 +580,11 @@ register_convex_counter!(
580580pub fn log_vector_prefetch_expiration ( ) {
581581 log_counter ( & VECTOR_PREFETCH_EXPIRATIONS_TOTAL , 1 ) ;
582582}
583+
584+ register_convex_histogram ! (
585+ TEXT_SEARCH_NUMBER_OF_SEGMENTS_TOTAL ,
586+ "Number of text segments searched for a multi segment text index"
587+ ) ;
588+ pub fn log_num_segments_searched_total ( num_segments : usize ) {
589+ log_distribution ( & TEXT_SEARCH_NUMBER_OF_SEGMENTS_TOTAL , num_segments as f64 ) ;
590+ }
You can’t perform that action at this time.
0 commit comments