#[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_unsupportedonce 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
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.frames_complete: u64Frames handed to the application with every packet present.
frames_incomplete: u64Frames 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: u64Blocks never seen at all: gaps in the block-id sequence.
frames_backpressure: u64Frames assembled and then discarded because the application did not take them before the delivery queue filled.
frames_unsupported: u64Blocks whose payload type the engine does not assemble.
packets_received: u64Datagrams read from the socket.
packets_duplicate: u64Packets received more than once.
packets_missing: u64Packets 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: u64Datagrams that are not GVSP.
packets_ignored_unsupported: u64Packets of a format or payload type the engine does not assemble.
packets_ignored_out_of_range: u64Data packets beyond the end of the frame buffer.
packets_ignored_late: u64Packets for a block already closed or older than the ones in flight.
packets_ignored_error_status: u64Leader or data packets whose status reports an error.
packets_ignored_foreign: u64Datagrams from an address other than the camera’s.
packets_size_mismatch: u64Data 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: u64Packets asked for again, each counted once however often it was asked.
resend_recovered: u64Packets asked for again that then arrived.
Packets asked for again that the camera answered it no longer has.
transfer_errors: u64USB3 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: u64Payload bytes of complete frames handed to the application.
last_frame_dt: DurationTime between the last two complete frames.
avg_fps: f64Smoothed rate of complete frames.
avg_mbps: f64Smoothed 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: DurationTime since the stream started.
packets_per_second: f64Average datagram rate since the stream started.
Implementations§
Source§impl StreamStats
impl StreamStats
Sourcepub fn frames_lost(&self) -> u64
pub fn frames_lost(&self) -> u64
Frames the application did not receive complete: incomplete, missed and dropped to backpressure.
Sourcepub fn packets_ignored(&self) -> u64
pub fn packets_ignored(&self) -> u64
Packets received and not used, for any reason.