pub struct NetworkSample {
pub rtt: Option<Duration>,
pub min_rtt: Option<Duration>,
pub loss: Option<f64>,
pub delivery: Option<u64>,
pub path_generation: u64,
pub throughput: Option<u64>,
pub send_rate: Option<u64>,
pub relayed: bool,
}Expand description
One reading of the link a broadcast arrives over.
Transports measure different things, so most fields are optional. A field
left None means unmeasured, not zero.
Fields§
§rtt: Option<Duration>The round trip to the peer.
min_rtt: Option<Duration>The smallest recent round trip on the current path.
This is the path’s delay with nothing queued.
loss: Option<f64>The fraction of this endpoint’s packets lost, in 0.0..=1.0.
On a subscriber these packets are mostly acknowledgements. The figure matches loss on the media’s direction only when both directions are impaired alike.
delivery: Option<u64>The sender’s estimate of what the path delivers, in bits per second.
The estimate is for the path to this endpoint. It is the only field that measures capacity. Adaptation caps the rendition’s bitrate with it.
path_generation: u64A counter that changes whenever the path changes.
Adaptation drops its history when it changes.
throughput: Option<u64>The rate bytes arrived at, in bits per second.
The count includes packet overhead and duplicates, so it is no capacity. Adaptation does not read it.
send_rate: Option<u64>The rate bytes left this endpoint at, in bits per second.
Like throughput, the count includes packet
overhead and retransmissions. On a publisher it is the uplink the media
uses. Adaptation does not read it.
relayed: boolWhether the path goes through an iroh relay rather than straight to the peer.