Skip to main content

MetricsRegistry

Struct MetricsRegistry 

Source
pub struct MetricsRegistry {
Show 40 fields pub connections_total: CachePadded<AtomicU64>, pub connections_active: CachePadded<AtomicI64>, pub connections_rejected: CachePadded<AtomicU64>, pub sessions_total: CachePadded<AtomicU64>, pub sessions_active: CachePadded<AtomicI64>, pub session_duration: Histogram, pub mounts_active: CachePadded<AtomicI64>, pub frames_accepted: CachePadded<AtomicU64>, pub frames_dropped: CachePadded<AtomicU64>, pub rtp_packets_sent: CachePadded<AtomicU64>, pub rtp_octets_sent: CachePadded<AtomicU64>, pub rtp_packets_received: CachePadded<AtomicU64>, pub rtcp_loss_ratio: Histogram, pub rtcp_jitter_ms: Histogram, pub rtcp_rtt_ms: Histogram, pub errors_by_code: [CachePadded<AtomicU64>; 12], pub proxy_reconnects: CachePadded<AtomicU64>, pub proxy_failovers: CachePadded<AtomicU64>, pub proxy_configured: CachePadded<AtomicI64>, pub proxy_streaming: CachePadded<AtomicI64>, pub client_sessions_total: CachePadded<AtomicU64>, pub client_sessions_active: CachePadded<AtomicI64>, pub client_reconnect_attempts: CachePadded<AtomicU64>, pub client_keep_alive_failures: CachePadded<AtomicU64>, pub client_fallbacks: CachePadded<AtomicU64>, pub rtmp_connections_total: CachePadded<AtomicU64>, pub rtmp_publishers_active: CachePadded<AtomicI64>, pub rtmp_players_active: CachePadded<AtomicI64>, pub srt_connections_total: CachePadded<AtomicU64>, pub srt_streams_active: CachePadded<AtomicI64>, pub srt_rtt_us: CachePadded<AtomicU64>, pub srt_loss_packets: CachePadded<AtomicU64>, pub srt_skipped_packets: CachePadded<AtomicU64>, pub srt_handshake_failures: CachePadded<AtomicU64>, pub webrtc_sessions_total: CachePadded<AtomicU64>, pub webrtc_sessions_active: CachePadded<AtomicI64>, pub http_requests_total: CachePadded<AtomicU64>, pub hls_segments_served: CachePadded<AtomicU64>, pub dash_segments_served: CachePadded<AtomicU64>, pub flv_streams_active: CachePadded<AtomicI64>,
}
Expand description

Metrics registry containing all server-level counters and histograms.

All fields use atomic types for lock-free access. Recording is designed to have minimal impact on the hot path.

Fields§

§connections_total: CachePadded<AtomicU64>§connections_active: CachePadded<AtomicI64>§connections_rejected: CachePadded<AtomicU64>§sessions_total: CachePadded<AtomicU64>§sessions_active: CachePadded<AtomicI64>§session_duration: Histogram§mounts_active: CachePadded<AtomicI64>§frames_accepted: CachePadded<AtomicU64>§frames_dropped: CachePadded<AtomicU64>§rtp_packets_sent: CachePadded<AtomicU64>§rtp_octets_sent: CachePadded<AtomicU64>§rtp_packets_received: CachePadded<AtomicU64>§rtcp_loss_ratio: Histogram§rtcp_jitter_ms: Histogram§rtcp_rtt_ms: Histogram§errors_by_code: [CachePadded<AtomicU64>; 12]§proxy_reconnects: CachePadded<AtomicU64>§proxy_failovers: CachePadded<AtomicU64>§proxy_configured: CachePadded<AtomicI64>

Configured proxy mounts.

§proxy_streaming: CachePadded<AtomicI64>

Proxy mounts currently streaming.

§client_sessions_total: CachePadded<AtomicU64>§client_sessions_active: CachePadded<AtomicI64>§client_reconnect_attempts: CachePadded<AtomicU64>§client_keep_alive_failures: CachePadded<AtomicU64>§client_fallbacks: CachePadded<AtomicU64>§rtmp_connections_total: CachePadded<AtomicU64>§rtmp_publishers_active: CachePadded<AtomicI64>§rtmp_players_active: CachePadded<AtomicI64>§srt_connections_total: CachePadded<AtomicU64>§srt_streams_active: CachePadded<AtomicI64>§srt_rtt_us: CachePadded<AtomicU64>

Last measured SRT round-trip time, microseconds.

§srt_loss_packets: CachePadded<AtomicU64>

Packets declared lost by NAK/TSBPD gap detection.

§srt_skipped_packets: CachePadded<AtomicU64>

Packets skipped by TLPKTDROP.

§srt_handshake_failures: CachePadded<AtomicU64>

Rejected SRT handshakes (any reason).

§webrtc_sessions_total: CachePadded<AtomicU64>§webrtc_sessions_active: CachePadded<AtomicI64>§http_requests_total: CachePadded<AtomicU64>§hls_segments_served: CachePadded<AtomicU64>§dash_segments_served: CachePadded<AtomicU64>§flv_streams_active: CachePadded<AtomicI64>

Implementations§

Source§

impl MetricsRegistry

Source

pub fn new() -> Self

Create a new metrics registry with all counters at zero.

Source

pub fn record_error(&self, code: ErrorCode)

Record an error code into the errors_by_code counter.

Trait Implementations§

Source§

impl Debug for MetricsRegistry

Source§

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

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

impl Default for MetricsRegistry

Source§

fn default() -> Self

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more