Skip to main content

ToolMetrics

Trait ToolMetrics 

Source
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§

Source

fn record_execution(&self, record: ToolExecutionRecord)

Record a tool execution for history and metrics.

Source

fn call_count(&self) -> u64

Get the total number of tool calls in this session.

Source

fn pty_poll_count(&self) -> u64

Get the total PTY poll iterations (for CPU monitoring).

Source

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".

Implementors§