pub struct Metrics {
pub llm_calls: AtomicU64,
pub llm_errors: AtomicU64,
pub tokens_used: AtomicU64,
pub debates: AtomicU64,
pub agents_created: AtomicU64,
pub verifications: AtomicU64,
pub verifications_passed: AtomicU64,
pub audit_events: AtomicU64,
}Expand description
Global metrics collector
Fields§
§llm_calls: AtomicU64Total LLM calls
llm_errors: AtomicU64Total LLM errors
tokens_used: AtomicU64Total tokens used
debates: AtomicU64Total debates run
agents_created: AtomicU64Total agents created
verifications: AtomicU64Total verifications (adversarial)
verifications_passed: AtomicU64Successful verifications
audit_events: AtomicU64Audit events logged
Implementations§
Source§impl Metrics
impl Metrics
Sourcepub fn record_llm_call(&self, tokens: u64, error: bool)
pub fn record_llm_call(&self, tokens: u64, error: bool)
Record an LLM call
Sourcepub fn record_debate(&self)
pub fn record_debate(&self)
Record a debate
Sourcepub fn record_agent_created(&self)
pub fn record_agent_created(&self)
Record agent creation
Sourcepub fn record_verification(&self, passed: bool)
pub fn record_verification(&self, passed: bool)
Record verification
Sourcepub fn record_audit_event(&self)
pub fn record_audit_event(&self)
Record audit event
Sourcepub fn snapshot(&self) -> MetricsSnapshot
pub fn snapshot(&self) -> MetricsSnapshot
Get snapshot of all metrics
Sourcepub fn verification_rate(&self) -> f64
pub fn verification_rate(&self) -> f64
Get verification success rate
Sourcepub fn llm_error_rate(&self) -> f64
pub fn llm_error_rate(&self) -> f64
Get LLM error rate
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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