pub struct BackendStats {Show 16 fields
pub backend_id: BackendId,
pub active_connections: ActiveConnections,
pub total_commands: CommandCount,
pub bytes_sent: BytesSent,
pub bytes_received: BytesReceived,
pub errors: ErrorCount,
pub errors_4xx: ErrorCount,
pub errors_5xx: ErrorCount,
pub article_bytes_total: ArticleBytesTotal,
pub article_count: ArticleCount,
pub ttfb_micros_total: TtfbMicros,
pub ttfb_count: TimingMeasurementCount,
pub send_micros_total: SendMicros,
pub recv_micros_total: RecvMicros,
pub connection_failures: FailureCount,
pub health_status: BackendHealthStatus,
}Expand description
Statistics for a single backend (cloneable snapshot)
Fields§
§backend_id: BackendId§active_connections: ActiveConnections§total_commands: CommandCount§bytes_sent: BytesSent§bytes_received: BytesReceived§errors: ErrorCount§errors_4xx: ErrorCount§errors_5xx: ErrorCount§article_bytes_total: ArticleBytesTotal§article_count: ArticleCount§ttfb_micros_total: TtfbMicros§ttfb_count: TimingMeasurementCount§send_micros_total: SendMicros§recv_micros_total: RecvMicros§connection_failures: FailureCount§health_status: BackendHealthStatusImplementations§
Source§impl BackendStats
impl BackendStats
Sourcepub const fn average_article_size(&self) -> Option<u64>
pub const fn average_article_size(&self) -> Option<u64>
Calculate average article size
Sourcepub fn average_ttfb_ms(&self) -> Option<f64>
pub fn average_ttfb_ms(&self) -> Option<f64>
Calculate average time to first byte in milliseconds
Sourcepub fn average_send_ms(&self) -> Option<f64>
pub fn average_send_ms(&self) -> Option<f64>
Calculate average send time in milliseconds
Sourcepub fn average_recv_ms(&self) -> Option<f64>
pub fn average_recv_ms(&self) -> Option<f64>
Calculate average receive time in milliseconds
Sourcepub fn average_overhead_ms(&self) -> Option<f64>
pub fn average_overhead_ms(&self) -> Option<f64>
Calculate async overhead in milliseconds
Sourcepub fn error_rate_percent(&self) -> f64
pub fn error_rate_percent(&self) -> f64
Calculate error rate as a percentage
Sourcepub fn has_high_error_rate(&self) -> bool
pub fn has_high_error_rate(&self) -> bool
Check if backend has high error rate (> 5%)
Sourcepub fn is_healthy(&self) -> bool
pub fn is_healthy(&self) -> bool
Check if backend is healthy
Sourcepub fn is_degraded(&self) -> bool
pub fn is_degraded(&self) -> bool
Check if backend is degraded
Sourcepub const fn total_bytes(&self) -> u64
pub const fn total_bytes(&self) -> u64
Get total bytes transferred
Sourcepub const fn has_activity(&self) -> bool
pub const fn has_activity(&self) -> bool
Check if backend has any activity
Trait Implementations§
Source§impl Clone for BackendStats
impl Clone for BackendStats
Source§fn clone(&self) -> BackendStats
fn clone(&self) -> BackendStats
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 BackendStats
impl Debug for BackendStats
Source§impl Default for BackendStats
impl Default for BackendStats
Source§impl<'de> Deserialize<'de> for BackendStats
impl<'de> Deserialize<'de> for BackendStats
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for BackendStats
impl RefUnwindSafe for BackendStats
impl Send for BackendStats
impl Sync for BackendStats
impl Unpin for BackendStats
impl UnsafeUnpin for BackendStats
impl UnwindSafe for BackendStats
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Code for Twhere
T: Serialize + DeserializeOwned,
impl<T> Code for Twhere
T: Serialize + DeserializeOwned,
Source§fn encode(&self, writer: &mut impl Write) -> Result<(), Error>
fn encode(&self, writer: &mut impl Write) -> Result<(), Error>
Encode the object into a writer. Read more
Source§fn decode(reader: &mut impl Read) -> Result<T, Error>
fn decode(reader: &mut impl Read) -> Result<T, Error>
Decode the object from a reader. Read more
Source§fn estimated_size(&self) -> usize
fn estimated_size(&self) -> usize
Estimated serialized size of the object. Read more
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> 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> ⓘ
Converts
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> ⓘ
Converts
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