pub struct Metrics {Show 13 fields
pub message_count: AtomicU64,
pub message_latency_sum_us: AtomicU64,
pub message_latency_count: AtomicU64,
pub agent_execution_time_sum_us: AtomicU64,
pub agent_execution_time_count: AtomicU64,
pub llm_tokens_total: AtomicU64,
pub llm_latency_sum_us: AtomicU64,
pub llm_latency_count: AtomicU64,
pub llm_cost_total_us: AtomicU64,
pub memory_hits: AtomicU64,
pub memory_misses: AtomicU64,
pub memory_writes: AtomicU64,
pub errors: DashMap<String, AtomicU64>,
}Fields§
§message_count: AtomicU64§message_latency_sum_us: AtomicU64§message_latency_count: AtomicU64§agent_execution_time_sum_us: AtomicU64§agent_execution_time_count: AtomicU64§llm_tokens_total: AtomicU64§llm_latency_sum_us: AtomicU64§llm_latency_count: AtomicU64§llm_cost_total_us: AtomicU64§memory_hits: AtomicU64§memory_misses: AtomicU64§memory_writes: AtomicU64§errors: DashMap<String, AtomicU64>Implementations§
Source§impl Metrics
impl Metrics
pub fn new() -> Metrics
pub fn record_message(&self, latency_us: u64)
pub fn record_agent_execution(&self, duration_us: u64)
pub fn record_llm_call(&self, duration_us: u64, tokens: u64, cost_us: u64)
pub fn record_memory_hit(&self)
pub fn record_memory_miss(&self)
pub fn record_memory_write(&self)
pub fn record_error(&self, error_type: &str)
pub fn snapshot(&self) -> MetricsSnapshot
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Metrics
impl !RefUnwindSafe for Metrics
impl Send for Metrics
impl Sync for Metrics
impl Unpin for Metrics
impl UnwindSafe for Metrics
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> 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