#[non_exhaustive]pub struct StreamCounters {Show 17 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_missing: u64,
pub packets_duplicate: u64,
pub packets_ignored: u64,
pub resend_requested: u64,
pub resend_recovered: u64,
pub resend_unavailable: u64,
pub transfer_errors: u64,
pub bytes: u64,
pub avg_mbps: f64,
pub avg_latency_ms: Option<f64>,
pub elapsed_ms: u64,
}Expand description
One stream’s counters on the wire: viva_genicam::StreamStats, with the
six reasons a packet was ignored summed into one.
USB3 Vision streams fill the frame counters the same way. Of the packet
counters, packets_received counts bulk transfers and packets_ignored
the transfers that were not the leader, payload or trailer due;
transfer_errors counts failed transfers the stream recovered from. The
other packet and resend counters stay 0.
Every block the camera sends is counted once, when its fate is decided: complete, incomplete, missed, dropped to backpressure or unsupported. A frame still waiting in the delivery queue is in none of them yet.
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. USB3 Vision: bulk transfers.
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_duplicate: u64Packets received more than once.
packets_ignored: u64Packets received and not used, for any reason: not GVSP, a format the engine does not assemble, beyond the end of the frame, late, an error status, or from an address other than the camera’s.
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.
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, in milliseconds, when the stream can map device time to host time.
elapsed_ms: u64Time since the stream started, in milliseconds.
Implementations§
Source§impl StreamCounters
impl StreamCounters
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.
Trait Implementations§
Source§impl Clone for StreamCounters
impl Clone for StreamCounters
impl Copy for StreamCounters
Source§impl Debug for StreamCounters
impl Debug for StreamCounters
Source§impl Default for StreamCounters
impl Default for StreamCounters
Source§impl<'de> Deserialize<'de> for StreamCounters
impl<'de> Deserialize<'de> for StreamCounters
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<&StreamStats> for StreamCounters
Available on crate feature genicam only.
impl From<&StreamStats> for StreamCounters
genicam only.Source§fn from(stats: &StreamStats) -> Self
fn from(stats: &StreamStats) -> Self
Source§impl PartialEq for StreamCounters
impl PartialEq for StreamCounters
Source§impl Serialize for StreamCounters
impl Serialize for StreamCounters
impl StructuralPartialEq for StreamCounters
Source§impl TS for StreamCounters
impl TS for StreamCounters
Source§type WithoutGenerics = StreamCounters
type WithoutGenerics = StreamCounters
WithoutGenerics should just be Self.
If the type does have generic parameters, then all generic parameters must be replaced with
a dummy type, e.g ts_rs::Dummy or (). The only requirement for these dummy types is that
EXPORT_TO must be None. Read moreSource§type OptionInnerType = StreamCounters
type OptionInnerType = StreamCounters
std::option::Option<T>, then this associated type is set to T.
All other implementations of TS should set this type to Self instead.Source§fn docs() -> Option<String>
fn docs() -> Option<String>
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§fn decl_concrete(cfg: &Config) -> String
fn decl_concrete(cfg: &Config) -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl(cfg: &Config) -> String
fn decl(cfg: &Config) -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline(cfg: &Config) -> String
fn inline(cfg: &Config) -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened(cfg: &Config) -> String
fn inline_flattened(cfg: &Config) -> String
Source§fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn output_path() -> Option<PathBuf>
fn output_path() -> Option<PathBuf>
T should be exported, relative to the output directory.
The returned path does not include any base directory. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
§fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
§fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export_all]. Read more§fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export]. Read more