pub struct ConnectionStats {
pub connections: u32,
pub video_frames_received: u64,
pub audio_frames_received: u64,
pub metadata_frames_received: u64,
pub video_frames_dropped: u64,
pub audio_frames_dropped: u64,
pub metadata_frames_dropped: u64,
pub video_frames_queued: u32,
pub audio_frames_queued: u32,
pub metadata_frames_queued: u32,
}Expand description
Connection and performance statistics for a receiver.
Provides detailed metrics about receiver health including connection count, frame counts, and drop rates. Useful for monitoring and diagnostics.
Fields§
§connections: u32Number of active connections to this receiver
video_frames_received: u64Total number of video frames received
audio_frames_received: u64Total number of audio frames received
metadata_frames_received: u64Total number of metadata frames received
video_frames_dropped: u64Number of video frames dropped due to buffer overflow or processing delays
audio_frames_dropped: u64Number of audio frames dropped
metadata_frames_dropped: u64Number of metadata frames dropped
video_frames_queued: u32Number of video frames currently queued for processing
audio_frames_queued: u32Number of audio frames currently queued
metadata_frames_queued: u32Number of metadata frames currently queued
Implementations§
Source§impl ConnectionStats
impl ConnectionStats
Sourcepub fn video_drop_percentage(&self) -> f64
pub fn video_drop_percentage(&self) -> f64
Calculate video frame drop percentage.
Returns the percentage of video frames that were dropped out of the total received + dropped. Returns 0.0 if no frames have been received.
§Examples
let stats = ConnectionStats {
connections: 1,
video_frames_received: 900,
video_frames_dropped: 100,
audio_frames_received: 0,
audio_frames_dropped: 0,
metadata_frames_received: 0,
metadata_frames_dropped: 0,
video_frames_queued: 5,
audio_frames_queued: 0,
metadata_frames_queued: 0,
};
assert_eq!(stats.video_drop_percentage(), 10.0);Sourcepub fn audio_drop_percentage(&self) -> f64
pub fn audio_drop_percentage(&self) -> f64
Calculate audio frame drop percentage.
Returns the percentage of audio frames that were dropped out of the total received + dropped. Returns 0.0 if no frames have been received.
Sourcepub fn metadata_drop_percentage(&self) -> f64
pub fn metadata_drop_percentage(&self) -> f64
Calculate metadata frame drop percentage.
Returns the percentage of metadata frames that were dropped out of the total received + dropped. Returns 0.0 if no frames have been received.
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check if the receiver is currently connected.
Returns true if there is at least one active connection.
Trait Implementations§
Source§impl Clone for ConnectionStats
impl Clone for ConnectionStats
Source§fn clone(&self) -> ConnectionStats
fn clone(&self) -> ConnectionStats
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more