api

http4k / org.http4k.chaos / ChaosBehaviours / Latency / fromEnv

fromEnv

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