Skip to main content

vtcode_core/tools/registry/
metrics_facade.rs

1//! Metrics-related accessors for ToolRegistry.
2
3use super::ToolRegistry;
4
5impl ToolRegistry {
6    /// Compatibility turn boundary for existing registry callers.
7    /// Previews are bounded per result, so there is no aggregate allowance
8    /// to reset and this boundary never changes output visibility.
9    pub fn begin_turn_preview_window(&self) {}
10
11    /// Return the shared metrics collector for this registry instance.
12    pub fn metrics_collector(&self) -> std::sync::Arc<crate::metrics::MetricsCollector> {
13        self.metrics.clone()
14    }
15
16    /// Get total tool calls made in current session (for observability).
17    pub fn tool_call_count(&self) -> u64 {
18        self.tool_call_counter.load(std::sync::atomic::Ordering::Relaxed)
19    }
20
21    /// Get total PTY poll iterations (for CPU monitoring).
22    pub fn pty_poll_count(&self) -> u64 {
23        self.pty_poll_counter.load(std::sync::atomic::Ordering::Relaxed)
24    }
25}