Skip to main content

RuntimeMetrics

Struct RuntimeMetrics 

Source
pub struct RuntimeMetrics {
Show 46 fields pub(super) http_requests: CounterFamily<HttpRoute>, pub(super) http_room_responses: CounterFamily<HttpRoomResponseStatus>, pub(super) http_disconnect_responses: CounterFamily<HttpDisconnectResponseStatus>, pub(super) http_inflight_requests: UpDownCounterFamily<HttpRoute>, pub(super) http_request_duration: HistogramFamily<HttpRoute, ControlPlaneDurationBucket>, pub(super) ws_connections: CounterFamily<WsConnectionStage>, pub(super) ws_handshake_rejections: CounterFamily<WebSocketCloseCode>, pub(super) ws_handshake_rejections_other: Counter, pub(super) ws_startup_failures: CounterFamily<WsStartupFailureKind>, pub(super) ws_user_loops_started: Counter, pub(super) ws_user_loop_exits: CounterFamily<WsSessionLoopExitReason>, pub(super) ws_bus_batches: CounterFamily<WsBusDirection>, pub(super) ws_bus_envelopes: CounterFamily<WsBusDirection>, pub(super) ws_bus_parse_failures: Counter, pub(super) ws_bus_failures: CounterFamily<WsBusFailureKind>, pub(super) ws_bus_client_frames: CounterFamily<WsBusClientFrameKind>, pub(super) ws_outbound_queued_messages: UpDownCounter, pub(super) ws_outbound_queue_overflows: Counter, pub(super) ws_handshake_duration: Histogram<ControlPlaneDurationBucket>, pub(super) ws_auth_duration: Histogram<ControlPlaneDurationBucket>, pub(super) ws_user_initialize_duration: Histogram<ControlPlaneDurationBucket>, pub(super) active_transport_users: UpDownCounter, pub(super) transport_health_users: UpDownCounterFamily<TransportHealthState>, pub(super) recording_actions: CounterFamily<RecordingActionOutcome>, pub(super) recording_captured_packets: Counter, pub(super) recording_captured_streams: Counter, pub(super) rtp_metrics: RtpMetrics, pub(super) rtc_metrics: RtcMetrics, pub(super) rtp_relay_overload_drops: CounterFamily<RtpRelayDropKind>, pub(super) transport_health_transitions: CounterFamily<TransportHealthTransition>, pub(super) transport_ice_state_changes: CounterFamily<TransportIceState>, pub(super) transport_dtls_connected: Counter, pub(super) transport_user_lifetime_buckets: CounterFamily<TransportUserLifetimeBucket>, pub(super) transport_user_lifetime_count: Counter, pub(super) transport_user_lifetime_sum_micros: Counter, pub(super) media_quality_samples: CounterFamily<MediaQualitySample>, pub(super) media_quality_rtt: HistogramFamily<MediaQualitySample, MediaQualityRttBucket>, pub(super) media_quality_loss_ppm_observed: CounterFamily<MediaQualityLossDirection>, pub(super) media_quality_loss_observations: CounterFamily<MediaQualityLossDirection>, pub(super) media_quality_bwe_bps_observed: Counter, pub(super) media_quality_bwe_observations: Counter, pub(super) media_quality_jitter_rtp_timestamp_units_observed: Counter, pub(super) media_quality_jitter_observations: Counter, pub(super) transport_cleanup_failures: Counter, pub(super) source_selection_updates: CounterFamily<SourceSelectionKind>, pub(super) budget_solver_outcomes: CounterFamily<BudgetSolverOutcome>,
}

Fields§

§http_requests: CounterFamily<HttpRoute>§http_room_responses: CounterFamily<HttpRoomResponseStatus>§http_disconnect_responses: CounterFamily<HttpDisconnectResponseStatus>§http_inflight_requests: UpDownCounterFamily<HttpRoute>§http_request_duration: HistogramFamily<HttpRoute, ControlPlaneDurationBucket>§ws_connections: CounterFamily<WsConnectionStage>§ws_handshake_rejections: CounterFamily<WebSocketCloseCode>§ws_handshake_rejections_other: Counter§ws_startup_failures: CounterFamily<WsStartupFailureKind>§ws_user_loops_started: Counter§ws_user_loop_exits: CounterFamily<WsSessionLoopExitReason>§ws_bus_batches: CounterFamily<WsBusDirection>§ws_bus_envelopes: CounterFamily<WsBusDirection>§ws_bus_parse_failures: Counter§ws_bus_failures: CounterFamily<WsBusFailureKind>§ws_bus_client_frames: CounterFamily<WsBusClientFrameKind>§ws_outbound_queued_messages: UpDownCounter§ws_outbound_queue_overflows: Counter§ws_handshake_duration: Histogram<ControlPlaneDurationBucket>§ws_auth_duration: Histogram<ControlPlaneDurationBucket>§ws_user_initialize_duration: Histogram<ControlPlaneDurationBucket>§active_transport_users: UpDownCounter§transport_health_users: UpDownCounterFamily<TransportHealthState>§recording_actions: CounterFamily<RecordingActionOutcome>§recording_captured_packets: Counter§recording_captured_streams: Counter§rtp_metrics: RtpMetrics§rtc_metrics: RtcMetrics§rtp_relay_overload_drops: CounterFamily<RtpRelayDropKind>§transport_health_transitions: CounterFamily<TransportHealthTransition>§transport_ice_state_changes: CounterFamily<TransportIceState>§transport_dtls_connected: Counter§transport_user_lifetime_buckets: CounterFamily<TransportUserLifetimeBucket>§transport_user_lifetime_count: Counter§transport_user_lifetime_sum_micros: Counter§media_quality_samples: CounterFamily<MediaQualitySample>§media_quality_rtt: HistogramFamily<MediaQualitySample, MediaQualityRttBucket>§media_quality_loss_ppm_observed: CounterFamily<MediaQualityLossDirection>§media_quality_loss_observations: CounterFamily<MediaQualityLossDirection>§media_quality_bwe_bps_observed: Counter§media_quality_bwe_observations: Counter§media_quality_jitter_rtp_timestamp_units_observed: Counter§media_quality_jitter_observations: Counter§transport_cleanup_failures: Counter§source_selection_updates: CounterFamily<SourceSelectionKind>§budget_solver_outcomes: CounterFamily<BudgetSolverOutcome>

Implementations§

Source§

impl RuntimeMetrics

Source

pub fn track_http_request(&self, route: HttpRoute) -> impl Drop + '_

counts one HTTP request then records duration and releases inflight state on drop

Source

pub fn record_http_room_success(&self)

Source

pub fn record_http_room_unauthorized(&self)

Source

pub fn record_http_room_forbidden(&self)

Source

pub fn record_http_room_bad_request(&self)

Source

pub fn record_http_room_conflict(&self)

Source

pub fn record_http_disconnect_success(&self)

Source

pub fn record_http_disconnect_bad_request(&self)

Source

pub fn record_http_disconnect_unprocessable_entity(&self)

Source

pub fn record_ws_connection_accepted(&self)

Source

pub fn record_ws_handshake_credentials_received(&self)

Source

pub fn record_ws_handshake_rejection( &self, close_code: Option<WebSocketCloseCode>, )

Source

pub fn record_ws_user_joined(&self)

Source

pub fn record_ws_startup_send_failure(&self)

Source

pub fn record_ws_user_initialize_failure(&self)

Source

pub fn record_ws_user_loop_started(&self)

Source

pub fn record_ws_user_loop_exit(&self, reason: WsSessionLoopExitReason)

Source

pub fn record_ws_bus_batch_received(&self, envelope_count: usize)

Source

pub fn record_ws_bus_invalid_input_failure(&self)

Source

pub fn record_ws_bus_unsupported_feature_failure(&self)

Source

pub fn record_ws_bus_client_request(&self)

Source

pub fn record_ws_bus_client_message(&self)

Source

pub fn record_ws_bus_batch_sent(&self, envelope_count: usize)

Source

pub fn record_ws_bus_batches_sent( &self, batch_count: usize, envelope_count: usize, )

Source

pub fn record_ws_bus_send_failure(&self)

Source

pub fn add_ws_outbound_queued_messages(&self, delta: i64)

Source

pub fn record_ws_outbound_queue_overflow(&self)

Source

pub fn track_ws_handshake(&self) -> impl Drop + '_

records handshake duration when the guard is dropped

Source

pub fn track_ws_authentication(&self) -> impl Drop + '_

records authentication duration when the guard is dropped

Source

pub fn track_ws_user_initialization(&self) -> impl Drop + '_

records user initialization duration when the guard is dropped

Source

fn track<'a>(&'a self, finish: impl Fn(&Self, Duration) + 'a) -> impl Drop + 'a

Source

pub fn add_active_transport_users(&self, delta: i64)

Source

pub fn record_transport_health_transition( &self, previous: Option<TransportHealthState>, next: Option<TransportHealthState>, )

records one transport-health edge and keeps current-state gauges balanced

callers must pass the previously recorded health value None -> Some joins the gauge Some -> None leaves it

Source

pub fn record_recording_start_accepted(&self)

Source

pub fn record_recording_start_rejected(&self)

Source

pub fn record_recording_stop_accepted(&self)

Source

pub fn record_recording_stop_rejected(&self)

Source

pub fn record_recording_captured_packet(&self)

Source

pub fn record_recording_captured_stream(&self)

Source

pub fn register_rtp_worker(&self) -> Arc<RtpMetricsRecorder>

Registers one worker-local recorder for hot RTP packet metrics.

The caller should keep the returned handle beside the packet loop and reuse it for every RTP packet observation owned by that worker.

Source

pub fn register_rtp_worker_for_media_worker( &self, media_worker_id: usize, ) -> Arc<RtpMetricsRecorder>

Registers one worker-local recorder for a known media worker.

The media-worker id is exported only as a bounded worker label. Runtime code must not pass room or user identity here.

Source

pub fn register_rtc_worker(&self) -> Arc<RtcMetricsRecorder>

Registers one worker-local recorder for RTC packet-loop metrics.

The caller should keep the returned handle beside the packet loop and reuse it for UDP datagram and route-control observations owned by that worker.

Source

pub fn record_rtp_relay_overload_drop(&self, destination: RtpRelayDropKind)

Source

pub fn record_transport_ice_state_change(&self, state: TransportIceState)

Source

pub fn record_transport_dtls_connected(&self)

Source

pub fn record_transport_user_lifetime(&self, duration: Duration)

Source

pub fn record_media_quality_sample(&self, sample: MediaQualitySample)

Source

pub fn record_media_quality_rtt( &self, sample: MediaQualitySample, duration: Duration, )

Source

pub fn record_media_quality_loss_ppm( &self, direction: MediaQualityLossDirection, loss_ppm: u64, )

Source

pub fn record_media_quality_bwe_bps(&self, bwe_bps: u64)

Source

pub fn record_media_quality_jitter_rtp_timestamp_units(&self, jitter: u64)

Source

pub fn record_transport_cleanup_failure(&self)

Source

pub fn record_source_selection_update(&self, selector: SourceSelectionKind)

Source

pub fn record_budget_solver_outcome(&self, outcome: BudgetSolverOutcome)

Trait Implementations§

Source§

impl Debug for RuntimeMetrics

Source§

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

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

impl Default for RuntimeMetrics

Source§

fn default() -> RuntimeMetrics

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.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

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

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

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.

§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. 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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,