pub struct AgentProtocolMetrics { /* private fields */ }Expand description
Low-cardinality agent protocol metric recorder.
Implementations§
Source§impl AgentProtocolMetrics
impl AgentProtocolMetrics
Sourcepub fn record_request(
&self,
protocol: &str,
operation: &str,
status: &str,
duration_ms: u64,
truncated: bool,
)
pub fn record_request( &self, protocol: &str, operation: &str, status: &str, duration_ms: u64, truncated: bool, )
Records a completed or failed protocol operation.
Sourcepub fn record_rejection(&self, protocol: &str, reason: &str)
pub fn record_rejection(&self, protocol: &str, reason: &str)
Records admission or protocol rejection before service execution.
Sourcepub fn record_cancelled(&self, protocol: &str)
pub fn record_cancelled(&self, protocol: &str)
Records cancellation.
Sourcepub fn record_cold_start(&self, protocol: &str, duration_ms: u64)
pub fn record_cold_start(&self, protocol: &str, duration_ms: u64)
Records the first initialize-to-tools/list discovery latency for a session.
Sourcepub fn snapshot(&self) -> AgentProtocolMetricsSnapshot
pub fn snapshot(&self) -> AgentProtocolMetricsSnapshot
Returns an in-process metric snapshot for diagnostics and tests.
Trait Implementations§
Source§impl Clone for AgentProtocolMetrics
impl Clone for AgentProtocolMetrics
Source§fn clone(&self) -> AgentProtocolMetrics
fn clone(&self) -> AgentProtocolMetrics
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 AgentProtocolMetrics
impl Debug for AgentProtocolMetrics
Source§impl Default for AgentProtocolMetrics
impl Default for AgentProtocolMetrics
Source§fn default() -> AgentProtocolMetrics
fn default() -> AgentProtocolMetrics
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AgentProtocolMetrics
impl RefUnwindSafe for AgentProtocolMetrics
impl Send for AgentProtocolMetrics
impl Sync for AgentProtocolMetrics
impl Unpin for AgentProtocolMetrics
impl UnsafeUnpin for AgentProtocolMetrics
impl UnwindSafe for AgentProtocolMetrics
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