emulateNetworkConditions

Activates emulation of network conditions.


suspend fun emulateNetworkConditions(offline: Boolean, latency: Double, downloadThroughput: Double, uploadThroughput: Double, connectionType: Network.ConnectionType? = null, packetLoss: Double? = null, packetQueueLength: Int? = null, packetReordering: Boolean? = null)

Activates emulation of network conditions.

Parameters

offline

True to emulate internet disconnection.

latency

Minimum latency from request sent to response headers received (ms).

downloadThroughput

Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.

uploadThroughput

Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling.

connectionType

Connection type if known.

packetLoss

WebRTC packet loss (percent, 0-100). 0 disables packet loss emulation, 100 drops all the packets.

packetQueueLength

WebRTC packet queue length (packet). 0 removes any queue length limitations.

packetReordering

WebRTC packetReordering feature.