pub struct UsageTracker { /* private fields */ }Expand description
Thread-safe usage tracker for ACP invocations.
Attach to an AcpAgentTool or use standalone to aggregate metrics.
§Example
ⓘ
use adk_acp::usage::UsageTracker;
let tracker = UsageTracker::new();
// ... tool invocations happen ...
let stats = tracker.stats();
println!("Total ACP calls: {}", stats.total_calls);
println!("Avg response time: {:?}", stats.total_duration / stats.total_calls as u32);Implementations§
Trait Implementations§
Source§impl Clone for UsageTracker
impl Clone for UsageTracker
Source§fn clone(&self) -> UsageTracker
fn clone(&self) -> UsageTracker
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 UsageTracker
impl Debug for UsageTracker
Source§impl Default for UsageTracker
impl Default for UsageTracker
Source§fn default() -> UsageTracker
fn default() -> UsageTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for UsageTracker
impl RefUnwindSafe for UsageTracker
impl Send for UsageTracker
impl Sync for UsageTracker
impl Unpin for UsageTracker
impl UnsafeUnpin for UsageTracker
impl UnwindSafe for UsageTracker
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