pub struct TransportMetrics {
pub RequestsTotal: u64,
pub RequestsSuccessful: u64,
pub RequestsFailed: u64,
pub NotificationsSent: u64,
pub ConnectionsEstablished: u64,
pub ConnectionFailures: u64,
pub BytesSent: u64,
pub BytesReceived: u64,
pub CircuitBreakerState: u32,
pub LatencyMillisecondsHistogram: Option<(u64, f64, f64)>,
pub ActiveConnections: u32,
pub PendingRequests: u32,
}Expand description
Transport performance metrics.
Fields§
§RequestsTotal: u64Total number of requests sent (including retries).
RequestsSuccessful: u64Total number of successful requests (2xx/OK responses).
RequestsFailed: u64Total number of failed requests (excludes timeouts/retries).
NotificationsSent: u64Total number of notifications sent.
ConnectionsEstablished: u64Total number of connections established (includes reconnections).
ConnectionFailures: u64Total number of connection failures.
BytesSent: u64Total bytes sent (compressed size if compression enabled).
BytesReceived: u64Total bytes received (compressed size if compression enabled).
CircuitBreakerState: u32Counter for circuit breaker state changes.
LatencyMillisecondsHistogram: Option<(u64, f64, f64)>Histogram of request latencies in milliseconds (p50, p95, p99). Stored as (count, sum, sum of squares) for online variance calculation.
ActiveConnections: u32Current active connections (gauge).
PendingRequests: u32Current pending requests (gauge).
Implementations§
Source§impl TransportMetrics
impl TransportMetrics
Sourcepub fn SuccessRate(&self) -> Option<f64>
pub fn SuccessRate(&self) -> Option<f64>
Computes the success rate as a percentage (0-100).
Sourcepub fn AverageLatency(&self) -> Option<f64>
pub fn AverageLatency(&self) -> Option<f64>
Computes the average request latency in milliseconds.
Sourcepub fn LatencyPercentile95(&self) -> Option<f64>
pub fn LatencyPercentile95(&self) -> Option<f64>
Computes the 95th percentile latency from the histogram.
Sourcepub fn RecordLatency(&mut self, LatencyMilliseconds: f64)
pub fn RecordLatency(&mut self, LatencyMilliseconds: f64)
Records a request latency sample.
Sourcepub fn IncrementRequestSuccess(&mut self)
pub fn IncrementRequestSuccess(&mut self)
Increments the RequestsTotal and RequestsSuccessful counters.
Sourcepub fn IncrementRequestFailure(&mut self)
pub fn IncrementRequestFailure(&mut self)
Increments the RequestsTotal and RequestsFailed counters.
Sourcepub fn SetCircuitBreakerState(&mut self, State: CircuitBreakerState)
pub fn SetCircuitBreakerState(&mut self, State: CircuitBreakerState)
Updates the circuit breaker state.
Trait Implementations§
Source§impl Clone for TransportMetrics
impl Clone for TransportMetrics
Source§fn clone(&self) -> TransportMetrics
fn clone(&self) -> TransportMetrics
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TransportMetrics
impl Debug for TransportMetrics
Source§impl Default for TransportMetrics
impl Default for TransportMetrics
Source§fn default() -> TransportMetrics
fn default() -> TransportMetrics
Auto Trait Implementations§
impl Freeze for TransportMetrics
impl RefUnwindSafe for TransportMetrics
impl Send for TransportMetrics
impl Sync for TransportMetrics
impl Unpin for TransportMetrics
impl UnsafeUnpin for TransportMetrics
impl UnwindSafe for TransportMetrics
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more