Skip to main content

TransportMetrics

Struct TransportMetrics 

Source
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: u64

Total number of requests sent (including retries).

§RequestsSuccessful: u64

Total number of successful requests (2xx/OK responses).

§RequestsFailed: u64

Total number of failed requests (excludes timeouts/retries).

§NotificationsSent: u64

Total number of notifications sent.

§ConnectionsEstablished: u64

Total number of connections established (includes reconnections).

§ConnectionFailures: u64

Total number of connection failures.

§BytesSent: u64

Total bytes sent (compressed size if compression enabled).

§BytesReceived: u64

Total bytes received (compressed size if compression enabled).

§CircuitBreakerState: u32

Counter 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: u32

Current active connections (gauge).

§PendingRequests: u32

Current pending requests (gauge).

Implementations§

Source§

impl TransportMetrics

Source

pub fn New() -> Self

Creates a new, empty metrics container.

Source

pub fn Reset(&mut self)

Resets all cumulative metrics to zero.

Source

pub fn SuccessRate(&self) -> Option<f64>

Computes the success rate as a percentage (0-100).

Source

pub fn AverageLatency(&self) -> Option<f64>

Computes the average request latency in milliseconds.

Source

pub fn LatencyPercentile95(&self) -> Option<f64>

Computes the 95th percentile latency from the histogram.

Source

pub fn RecordLatency(&mut self, LatencyMilliseconds: f64)

Records a request latency sample.

Source

pub fn IncrementRequestSuccess(&mut self)

Increments the RequestsTotal and RequestsSuccessful counters.

Source

pub fn IncrementRequestFailure(&mut self)

Increments the RequestsTotal and RequestsFailed counters.

Source

pub fn SetCircuitBreakerState(&mut self, State: CircuitBreakerState)

Updates the circuit breaker state.

Trait Implementations§

Source§

impl Clone for TransportMetrics

Source§

fn clone(&self) -> TransportMetrics

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TransportMetrics

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TransportMetrics

Source§

fn default() -> TransportMetrics

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,

§

impl<T> UserEvent for T
where T: Debug + Clone + Send + 'static,