pub struct AuditLog { /* private fields */ }Expand description
An append-only audit log of query entries.
Implementations§
Source§impl AuditLog
impl AuditLog
Sourcepub fn record(&self, entry: AuditEntry)
pub fn record(&self, entry: AuditEntry)
Append an entry.
Sourcepub fn total_tokens_used(&self) -> u64
pub fn total_tokens_used(&self) -> u64
Total tokens used across all entries.
Sourcepub fn total_tokens_saved(&self) -> u64
pub fn total_tokens_saved(&self) -> u64
Total tokens saved across all entries.
Sourcepub fn cache_hit_rate(&self) -> f64
pub fn cache_hit_rate(&self) -> f64
Cache hit rate across all entries.
Sourcepub fn layer_distribution(&self) -> Vec<(Layer, usize)>
pub fn layer_distribution(&self) -> Vec<(Layer, usize)>
Distribution of queries across layers: (layer, count).
Sourcepub fn entries(&self) -> Vec<AuditEntry>
pub fn entries(&self) -> Vec<AuditEntry>
Get a clone of all entries.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AuditLog
impl RefUnwindSafe for AuditLog
impl Send for AuditLog
impl Sync for AuditLog
impl Unpin for AuditLog
impl UnsafeUnpin for AuditLog
impl UnwindSafe for AuditLog
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