ChaosConfig

data class ChaosConfig(val failureRate: Double = 0.0, val latency: Duration = Duration.ZERO, val latencyJitter: Duration = Duration.ZERO, val random: Random = Random.Default, val exception: () -> Throwable = { ChaosException() })(source)

Configuration for chaos-injected faults.

Constructors

Link copied to clipboard
constructor(failureRate: Double = 0.0, latency: Duration = Duration.ZERO, latencyJitter: Duration = Duration.ZERO, random: Random = Random.Default, exception: () -> Throwable = { ChaosException() })

Properties

Link copied to clipboard
val exception: () -> Throwable

Factory for the exception thrown on a simulated failure.

Link copied to clipboard

Probability (0.0..1.0) that a given call fails with exception.

Link copied to clipboard

Fixed latency added before every call (successful or not).

Link copied to clipboard

Additional random latency in [0, latencyJitter) added on top of latency.

Link copied to clipboard

Source of randomness; inject a seeded Random for deterministic tests.