pub struct PilotMetrics {Show 17 fields
pub total_calls: usize,
pub successful_calls: usize,
pub failed_calls: usize,
pub fallback_calls: usize,
pub total_input_tokens: usize,
pub total_output_tokens: usize,
pub avg_tokens_per_call: f64,
pub total_latency_ms: u64,
pub avg_latency_ms: f64,
pub p50_latency_ms: u64,
pub p99_latency_ms: u64,
pub start_interventions: usize,
pub fork_interventions: usize,
pub backtrack_interventions: usize,
pub evaluate_interventions: usize,
pub llm_accuracy: Option<f64>,
pub retrieval_precision: Option<f64>,
}Expand description
Snapshot of Pilot metrics at a point in time.
Fields§
§total_calls: usizeTotal LLM calls attempted.
successful_calls: usizeSuccessful LLM calls.
failed_calls: usizeFailed LLM calls.
fallback_calls: usizeCalls that needed fallback.
total_input_tokens: usizeTotal input tokens consumed.
total_output_tokens: usizeTotal output tokens generated.
avg_tokens_per_call: f64Average tokens per call.
total_latency_ms: u64Total time spent in LLM calls (ms).
avg_latency_ms: f64Average latency per call (ms).
p50_latency_ms: u64P50 latency (ms).
p99_latency_ms: u64P99 latency (ms).
start_interventions: usizeCalls at START point.
fork_interventions: usizeCalls at FORK point.
backtrack_interventions: usizeCalls at BACKTRACK point.
evaluate_interventions: usizeCalls at EVALUATE point.
llm_accuracy: Option<f64>LLM decision accuracy (0.0-1.0).
retrieval_precision: Option<f64>Retrieval precision (0.0-1.0).
Implementations§
Source§impl PilotMetrics
impl PilotMetrics
Sourcepub fn success_rate(&self) -> f64
pub fn success_rate(&self) -> f64
Calculate success rate (0.0-1.0).
Sourcepub fn token_utilization(&self, budget: usize) -> f64
pub fn token_utilization(&self, budget: usize) -> f64
Calculate token utilization.
Sourcepub fn fallback_rate(&self) -> f64
pub fn fallback_rate(&self) -> f64
Calculate fallback rate (0.0-1.0).
Trait Implementations§
Source§impl Clone for PilotMetrics
impl Clone for PilotMetrics
Source§fn clone(&self) -> PilotMetrics
fn clone(&self) -> PilotMetrics
Returns a duplicate of the value. Read more
1.0.0 · 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 PilotMetrics
impl Debug for PilotMetrics
Source§impl Default for PilotMetrics
impl Default for PilotMetrics
Source§fn default() -> PilotMetrics
fn default() -> PilotMetrics
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PilotMetrics
impl RefUnwindSafe for PilotMetrics
impl Send for PilotMetrics
impl Sync for PilotMetrics
impl Unpin for PilotMetrics
impl UnsafeUnpin for PilotMetrics
impl UnwindSafe for PilotMetrics
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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