//! Per-query observability stats for the adaptive query planner.

use std::time::Duration;

use super::strategy::AnnStrategy;

/// Per-query observability stats captured by the adaptive query planner.
///
/// These stats are for external monitoring and analysis only -- the planner
/// does NOT use them for self-tuning. They enable dashboards and alerting
/// on strategy selection distribution, latency by strategy, and recall
/// degradation under selective filters.
#[derive(Debug, Clone)]
pub struct AnnQueryStats {
    /// The selectivity estimate that was used to select the strategy.
    pub estimated_selectivity: f64,

    /// The strategy that was selected and executed.
    pub strategy: AnnStrategy,

    /// Number of results actually returned (may be less than `requested_k`
    /// if the index is smaller or the filter is very selective).
    pub results_returned: usize,

    /// The `k` value requested by the caller.
    pub requested_k: usize,

    /// Wall-clock latency of the search execution (excluding strategy selection).
    pub latency: Duration,
}
