pub struct CountingObserver { /* private fields */ }Expand description
An Observer that counts the events it sees. Cheap to clone (shared
counters) so a copy can be handed to the engine and another kept for asserts.
Implementations§
Source§impl CountingObserver
impl CountingObserver
Sourcepub fn frames(&self) -> u64
pub fn frames(&self) -> u64
Total frames observed via Observer::on_frame.
Sourcepub fn publish_started(&self) -> u64
pub fn publish_started(&self) -> u64
Count of Observer::on_publish_started calls.
Sourcepub fn publish_ended(&self) -> u64
pub fn publish_ended(&self) -> u64
Count of Observer::on_publish_ended calls.
Sourcepub fn events(&self) -> u64
pub fn events(&self) -> u64
Count of Observer::on_event calls.
Sourcepub fn lagged(&self) -> u64
pub fn lagged(&self) -> u64
Total frames reported dropped via Observer::on_subscriber_lagged.
Trait Implementations§
Source§impl Clone for CountingObserver
impl Clone for CountingObserver
Source§fn clone(&self) -> CountingObserver
fn clone(&self) -> CountingObserver
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 Default for CountingObserver
impl Default for CountingObserver
Source§fn default() -> CountingObserver
fn default() -> CountingObserver
Returns the “default value” for a type. Read more
Source§impl Observer for CountingObserver
impl Observer for CountingObserver
Source§fn on_event(&self, _event: &StreamEvent)
fn on_event(&self, _event: &StreamEvent)
A stream lifecycle event was emitted.
Source§fn on_publish_started(&self, _app: &str)
fn on_publish_started(&self, _app: &str)
A publish session started in application
app.Source§fn on_publish_ended(&self, _app: &str)
fn on_publish_ended(&self, _app: &str)
A publish session ended in application
app.Source§fn on_frame(&self, _key: &StreamKey, _frame: &MediaFrame)
fn on_frame(&self, _key: &StreamKey, _frame: &MediaFrame)
A frame was published. Hot-path hook — keep it cheap. The default
is a no-op so the branch is trivially predicted away when no observer
is installed.
Source§fn on_subscriber_lagged(&self, _key: &StreamKey, skipped: u64)
fn on_subscriber_lagged(&self, _key: &StreamKey, skipped: u64)
A subscriber fell behind the broadcast buffer and
skipped frames were
dropped from its view before it could read them. This is the canonical
slow-consumer signal: alert on it. Fired by
StreamHandle::subscribe_resilient.Source§fn on_subscriber_evicted(&self, _key: &StreamKey)
fn on_subscriber_evicted(&self, _key: &StreamKey)
A chronically slow subscriber crossed its
max_lag budget and was shed.
Fired by Subscription::recv.Source§fn on_rate_limited(&self, _key: &StreamKey)
fn on_rate_limited(&self, _key: &StreamKey)
An ingress rate limit was exceeded for
key; the protocol handler should
drop or backpressure the connection. Handlers call this from their
ingest loop (e.g. when IngestRateLimit
returns false).Source§fn on_stream_reaped(&self, _key: &StreamKey)
fn on_stream_reaped(&self, _key: &StreamKey)
A publish session was reaped for exceeding the engine’s idle timeout.
Auto Trait Implementations§
impl Freeze for CountingObserver
impl RefUnwindSafe for CountingObserver
impl Send for CountingObserver
impl Sync for CountingObserver
impl Unpin for CountingObserver
impl UnsafeUnpin for CountingObserver
impl UnwindSafe for CountingObserver
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