pub struct NetworkConditions {
pub url_pattern: String,
pub latency: f64,
pub download_throughput: f64,
pub upload_throughput: f64,
pub connection_type: Option<ConnectionType>,
pub packet_loss: Option<f64>,
pub packet_queue_length: Option<i64>,
pub packet_reordering: Option<bool>,
pub offline: Option<bool>,
}Expand description
Experimental: may change without notice.
Fields§
§url_pattern: StringOnly matching requests will be affected by these conditions. Patterns use the URLPattern constructor string syntax (https://urlpattern.spec.whatwg.org/) and must be absolute. If the pattern is empty, all requests are matched (including p2p connections).
latency: f64Minimum latency from request sent to response headers received (ms).
download_throughput: f64Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.
upload_throughput: f64Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling.
connection_type: Option<ConnectionType>Connection type if known.
packet_loss: Option<f64>WebRTC packet loss (percent, 0-100). 0 disables packet loss emulation, 100 drops all the packets.
packet_queue_length: Option<i64>WebRTC packet queue length (packet). 0 removes any queue length limitations.
packet_reordering: Option<bool>WebRTC packetReordering feature.
offline: Option<bool>True to emulate internet disconnection.