Latency

object Latency

Blocks the thread for a random amount of time within the allocated range.

Functions

Link copied to clipboard
fun fromEnv(env: (String) -> String? = System::getenv, defaultMin: Duration = ofMillis(100), defaultMax: Duration = ofMillis(500), minName: String = "CHAOS_LATENCY_MS_MIN", maxName: String = "CHAOS_LATENCY_MS_MAX"): Behaviour

Get a latency range from the environment. Defaults to CHAOS_LATENCY_MS_MIN/MAX and a value of 100ms -> 500ms

Link copied to clipboard
operator fun invoke(min: Duration = ofMillis(100), max: Duration = ofMillis(500)): Behaviour