pub struct QueryTelemetry {
pub query_id: String,
pub query_class: String,
pub start_time: Option<Instant>,
pub total_duration_us: u64,
pub routing: RoutingMetrics,
pub scan: ScanMetrics,
pub rerank: RerankMetrics,
pub cache: CacheMetrics,
pub error_envelope: ErrorEnvelopeMetrics,
pub termination: TerminationMetrics,
pub cost: Option<CostSummaryJson>,
pub tags: HashMap<String, String>,
}Expand description
Comprehensive per-query telemetry
Fields§
§query_id: StringQuery identifier (for correlation)
query_class: StringQuery class (e.g., “low_latency”, “high_recall”)
start_time: Option<Instant>Timestamp when query started
total_duration_us: u64Total query duration
routing: RoutingMetricsRouting phase metrics
scan: ScanMetricsScan phase metrics
rerank: RerankMetricsRerank phase metrics
cache: CacheMetricsCache metrics
error_envelope: ErrorEnvelopeMetricsError envelope metrics
termination: TerminationMetricsTermination metrics
cost: Option<CostSummaryJson>Cost summary (if budget tracking enabled)
Custom tags for filtering/grouping
Implementations§
Source§impl QueryTelemetry
impl QueryTelemetry
Sourcepub fn record_routing(
&mut self,
duration: Duration,
lists_considered: u32,
lists_scanned: u32,
)
pub fn record_routing( &mut self, duration: Duration, lists_considered: u32, lists_scanned: u32, )
Record routing phase
Sourcepub fn record_routing_full(
&mut self,
duration: Duration,
lists_considered: u32,
lists_scanned: u32,
centroid_comparisons: u32,
used_compressed: bool,
strategy: &str,
)
pub fn record_routing_full( &mut self, duration: Duration, lists_considered: u32, lists_scanned: u32, centroid_comparisons: u32, used_compressed: bool, strategy: &str, )
Record routing with full details
Sourcepub fn record_scan(&mut self, codes_evaluated: u64, ram_bytes: u64)
pub fn record_scan(&mut self, codes_evaluated: u64, ram_bytes: u64)
Record scan phase
Sourcepub fn record_scan_full(
&mut self,
duration: Duration,
codes_evaluated: u64,
ram_bytes: u64,
simd_ops: u64,
candidates_stage1: u32,
distance_metric: &str,
quant_level: &str,
)
pub fn record_scan_full( &mut self, duration: Duration, codes_evaluated: u64, ram_bytes: u64, simd_ops: u64, candidates_stage1: u32, distance_metric: &str, quant_level: &str, )
Record scan with full details
Sourcepub fn record_rerank(
&mut self,
duration: Duration,
candidates_in: u32,
candidates_out: u32,
ssd_random_reads: u32,
ssd_sequential_bytes: u64,
)
pub fn record_rerank( &mut self, duration: Duration, candidates_in: u32, candidates_out: u32, ssd_random_reads: u32, ssd_sequential_bytes: u64, )
Record rerank phase
Sourcepub fn record_io_coalescing(&mut self, coalesced: bool, ranges: u32)
pub fn record_io_coalescing(&mut self, coalesced: bool, ranges: u32)
Record IO coalescing details
Sourcepub fn record_cache_hit(&mut self, cache_type: CacheType)
pub fn record_cache_hit(&mut self, cache_type: CacheType)
Record cache hits/misses
Sourcepub fn record_cache_miss(&mut self, cache_type: CacheType)
pub fn record_cache_miss(&mut self, cache_type: CacheType)
Record cache miss
Sourcepub fn set_guarantee_mode(&mut self, mode: &GuaranteeMode)
pub fn set_guarantee_mode(&mut self, mode: &GuaranteeMode)
Set guarantee mode
Sourcepub fn record_error_bounds(&mut self, max_error: f32, mean_error: f32)
pub fn record_error_bounds(&mut self, max_error: f32, mean_error: f32)
Record error bounds observed
Sourcepub fn set_stop_reason(
&mut self,
reason: StopReason,
probes: u32,
max_probes: u32,
)
pub fn set_stop_reason( &mut self, reason: StopReason, probes: u32, max_probes: u32, )
Set stop reason
Sourcepub fn set_miss_probability(&mut self, prob: f32)
pub fn set_miss_probability(&mut self, prob: f32)
Set miss probability
Sourcepub fn set_result_count(&mut self, count: u32)
pub fn set_result_count(&mut self, count: u32)
Set result count
Sourcepub fn attach_cost(&mut self, summary: CostSummary)
pub fn attach_cost(&mut self, summary: CostSummary)
Attach cost summary
Sourcepub fn to_json_pretty(&self) -> String
pub fn to_json_pretty(&self) -> String
Serialize to pretty JSON
Trait Implementations§
Source§impl Clone for QueryTelemetry
impl Clone for QueryTelemetry
Source§fn clone(&self) -> QueryTelemetry
fn clone(&self) -> QueryTelemetry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for QueryTelemetry
impl Debug for QueryTelemetry
Source§impl<'de> Deserialize<'de> for QueryTelemetry
impl<'de> Deserialize<'de> for QueryTelemetry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for QueryTelemetry
impl RefUnwindSafe for QueryTelemetry
impl Send for QueryTelemetry
impl Sync for QueryTelemetry
impl Unpin for QueryTelemetry
impl UnsafeUnpin for QueryTelemetry
impl UnwindSafe for QueryTelemetry
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more