Skip to main content

StreamStats

Struct StreamStats 

Source
#[non_exhaustive]
pub struct StreamStats {
Show 26 fields pub frames_complete: u64, pub frames_incomplete: u64, pub frames_missed: u64, pub frames_backpressure: u64, pub frames_unsupported: u64, pub packets_received: u64, pub packets_duplicate: u64, pub packets_missing: u64, pub packets_ignored_malformed: u64, pub packets_ignored_unsupported: u64, pub packets_ignored_out_of_range: u64, pub packets_ignored_late: u64, pub packets_ignored_error_status: u64, pub packets_ignored_foreign: u64, pub packets_size_mismatch: u64, pub resend_requested: u64, pub resend_recovered: u64, pub resend_unavailable: u64, pub transfer_errors: u64, pub bytes: u64, pub last_frame_dt: Duration, pub avg_fps: f64, pub avg_mbps: f64, pub avg_latency_ms: Option<f64>, pub elapsed: Duration, pub packets_per_second: f64,
}
Expand description

Snapshot of one stream’s counters (backlog SR-07).

USB3 Vision streams fill the frame counters the same way, and of the packet counters: packets_received counts bulk transfers, packets_ignored_malformed the transfers that were not the leader, payload or trailer due, and transfer_errors the failed transfers the stream recovered from. The other packet and resend counters stay 0.

Frames. Every block the camera sends is counted exactly once, when its fate is decided, so that

blocks sent = frames_complete + frames_incomplete + frames_missed
            + frames_backpressure + frames_unsupported

once nothing is in flight and the delivery queue is drained. A frame waiting in the queue is in none of them yet.

Packets. packets_received counts every datagram read from the socket; the other packet counters say what became of the ones that were not used.

Resend. Each packet asked for again counts once in resend_requested, however many requests it took, and then at most once more: in resend_recovered if it arrived, in resend_unavailable if the camera said it no longer has it. What is left was neither — lost again, or its frame closed first.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§frames_complete: u64

Frames handed to the application with every packet present.

§frames_incomplete: u64

Frames closed without that: packets missing, no trailer, or an error status from the device. Counted whether or not the stream delivers incomplete frames.

§frames_missed: u64

Blocks never seen at all: gaps in the block-id sequence.

§frames_backpressure: u64

Frames assembled and then discarded because the application did not take them before the delivery queue filled.

§frames_unsupported: u64

Blocks whose payload type the engine does not assemble.

§packets_received: u64

Datagrams read from the socket.

§packets_duplicate: u64

Packets received more than once.

§packets_missing: u64

Packets never received, of frames closed incomplete. A lower bound when a trailer is missing, since the trailer is what says how many there were.

§packets_ignored_malformed: u64

Datagrams that are not GVSP.

§packets_ignored_unsupported: u64

Packets of a format or payload type the engine does not assemble.

§packets_ignored_out_of_range: u64

Data packets beyond the end of the frame buffer.

§packets_ignored_late: u64

Packets for a block already closed or older than the ones in flight.

§packets_ignored_error_status: u64

Leader or data packets whose status reports an error.

§packets_ignored_foreign: u64

Datagrams from an address other than the camera’s.

§packets_size_mismatch: u64

Data packets, other than a block’s last, whose length is not the stride the packet size implies. They are not used: a frame that had one closes incomplete.

§resend_requested: u64

Packets asked for again, each counted once however often it was asked.

§resend_recovered: u64

Packets asked for again that then arrived.

§resend_unavailable: u64

Packets asked for again that the camera answered it no longer has.

§transfer_errors: u64

USB3 Vision: transfers that failed — a stall, a fault — and that the stream recovered from by resetting its endpoint, at the cost of the block in progress. 0 on GigE Vision.

§bytes: u64

Payload bytes of complete frames handed to the application.

§last_frame_dt: Duration

Time between the last two complete frames.

§avg_fps: f64

Smoothed rate of complete frames.

§avg_mbps: f64

Smoothed payload throughput of complete frames, in megabits a second.

§avg_latency_ms: Option<f64>

Smoothed delay from the device timestamp to delivery, when the stream can map device time to host time.

§elapsed: Duration

Time since the stream started.

§packets_per_second: f64

Average datagram rate since the stream started.

Implementations§

Source§

impl StreamStats

Source

pub fn frames_lost(&self) -> u64

Frames the application did not receive complete: incomplete, missed and dropped to backpressure.

Source

pub fn packets_ignored(&self) -> u64

Packets received and not used, for any reason.

Trait Implementations§

Source§

impl Clone for StreamStats

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for StreamStats

Source§

impl Debug for StreamStats

Source§

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

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

impl Default for StreamStats

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for StreamStats

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for StreamStats

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
§

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,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

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