pub struct ProtocolMetrics {Show 14 fields
pub requests_total: AtomicU64,
pub responses_total: AtomicU64,
pub timeouts_total: AtomicU64,
pub connection_errors_total: AtomicU64,
pub serialization_errors_total: AtomicU64,
pub flow_control_pauses_total: AtomicU64,
pub flow_control_resumes_total: AtomicU64,
pub flow_control_rejections_total: AtomicU64,
pub in_flight_requests: AtomicU64,
pub buffer_utilization_percent: AtomicU64,
pub healthy_connections: AtomicU64,
pub paused_connections: AtomicU64,
pub serialization_time: HistogramMetric,
pub request_duration: HistogramMetric,
}Expand description
Protocol-level metrics for the agent pool.
Fields§
§requests_total: AtomicU64Total requests sent
responses_total: AtomicU64Total responses received
timeouts_total: AtomicU64Requests that timed out
connection_errors_total: AtomicU64Connection errors
serialization_errors_total: AtomicU64Serialization errors
flow_control_pauses_total: AtomicU64Flow control pause events
flow_control_resumes_total: AtomicU64Flow control resume events
flow_control_rejections_total: AtomicU64Requests rejected due to flow control
in_flight_requests: AtomicU64Current in-flight requests
buffer_utilization_percent: AtomicU64Current buffer utilization (0-100)
healthy_connections: AtomicU64Number of healthy connections
paused_connections: AtomicU64Number of paused connections (flow control)
serialization_time: HistogramMetricSerialization time histogram
request_duration: HistogramMetricRequest duration histogram (end-to-end)
Implementations§
Source§impl ProtocolMetrics
impl ProtocolMetrics
Sourcepub fn inc_requests(&self)
pub fn inc_requests(&self)
Increment requests total.
Sourcepub fn inc_responses(&self)
pub fn inc_responses(&self)
Increment responses total.
Sourcepub fn inc_timeouts(&self)
pub fn inc_timeouts(&self)
Increment timeouts.
Sourcepub fn inc_connection_errors(&self)
pub fn inc_connection_errors(&self)
Increment connection errors.
Sourcepub fn inc_serialization_errors(&self)
pub fn inc_serialization_errors(&self)
Increment serialization errors.
Sourcepub fn record_flow_pause(&self)
pub fn record_flow_pause(&self)
Record flow control pause.
Sourcepub fn record_flow_resume(&self)
pub fn record_flow_resume(&self)
Record flow control resume.
Sourcepub fn record_flow_rejection(&self)
pub fn record_flow_rejection(&self)
Record flow control rejection.
Sourcepub fn set_in_flight(&self, count: u64)
pub fn set_in_flight(&self, count: u64)
Set in-flight requests gauge.
Sourcepub fn inc_in_flight(&self)
pub fn inc_in_flight(&self)
Increment in-flight requests.
Sourcepub fn dec_in_flight(&self)
pub fn dec_in_flight(&self)
Decrement in-flight requests.
Sourcepub fn set_buffer_utilization(&self, percent: u64)
pub fn set_buffer_utilization(&self, percent: u64)
Set buffer utilization percentage.
Sourcepub fn set_healthy_connections(&self, count: u64)
pub fn set_healthy_connections(&self, count: u64)
Set healthy connections gauge.
Sourcepub fn set_paused_connections(&self, count: u64)
pub fn set_paused_connections(&self, count: u64)
Set paused connections gauge.
Sourcepub fn record_serialization_time(&self, duration: Duration)
pub fn record_serialization_time(&self, duration: Duration)
Record serialization time.
Sourcepub fn record_request_duration(&self, duration: Duration)
pub fn record_request_duration(&self, duration: Duration)
Record request duration.
Sourcepub fn snapshot(&self) -> ProtocolMetricsSnapshot
pub fn snapshot(&self) -> ProtocolMetricsSnapshot
Get a snapshot of all metrics.
Sourcepub fn to_prometheus(&self, prefix: &str) -> String
pub fn to_prometheus(&self, prefix: &str) -> String
Export metrics in Prometheus text format.
Trait Implementations§
Source§impl Debug for ProtocolMetrics
impl Debug for ProtocolMetrics
Source§impl Default for ProtocolMetrics
impl Default for ProtocolMetrics
Source§fn default() -> ProtocolMetrics
fn default() -> ProtocolMetrics
Auto Trait Implementations§
impl !Freeze for ProtocolMetrics
impl RefUnwindSafe for ProtocolMetrics
impl Send for ProtocolMetrics
impl Sync for ProtocolMetrics
impl Unpin for ProtocolMetrics
impl UnsafeUnpin for ProtocolMetrics
impl UnwindSafe for ProtocolMetrics
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request