pub trait ToolMetrics: Send + Sync {
// Required methods
fn record_execution(&self, record: ToolExecutionRecord);
fn call_count(&self) -> u64;
fn pty_poll_count(&self) -> u64;
fn metrics_collector(&self) -> Arc<MetricsCollector> ⓘ;
}Expand description
Tool execution metrics and history tracking.
Records execution outcomes for observability, debugging, and loop detection.
Required Methods§
Sourcefn record_execution(&self, record: ToolExecutionRecord)
fn record_execution(&self, record: ToolExecutionRecord)
Record a tool execution for history and metrics.
Sourcefn call_count(&self) -> u64
fn call_count(&self) -> u64
Get the total number of tool calls in this session.
Sourcefn pty_poll_count(&self) -> u64
fn pty_poll_count(&self) -> u64
Get the total PTY poll iterations (for CPU monitoring).
Sourcefn metrics_collector(&self) -> Arc<MetricsCollector> ⓘ
fn metrics_collector(&self) -> Arc<MetricsCollector> ⓘ
Get the shared metrics collector for external observability.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".