diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-03-16 23:07:22 +0100 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-03-25 10:48:58 +0100 |
| commit | 5ff443c799322836d532fffb3ff8f720806c32b6 (patch) | |
| tree | 6844c2c1cd3b22ff3469d7c359cf47f558400ebd /opendc/opendc-core | |
| parent | a5d22796a95b187bc07cbd55a2289185bd9092b8 (diff) | |
feat: Add failures to SC20 experiment
Diffstat (limited to 'opendc/opendc-core')
| -rw-r--r-- | opendc/opendc-core/src/main/kotlin/com/atlarge/opendc/core/failure/UncorrelatedFaultInjector.kt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/opendc/opendc-core/src/main/kotlin/com/atlarge/opendc/core/failure/UncorrelatedFaultInjector.kt b/opendc/opendc-core/src/main/kotlin/com/atlarge/opendc/core/failure/UncorrelatedFaultInjector.kt index 95127deb..5155a25a 100644 --- a/opendc/opendc-core/src/main/kotlin/com/atlarge/opendc/core/failure/UncorrelatedFaultInjector.kt +++ b/opendc/opendc-core/src/main/kotlin/com/atlarge/opendc/core/failure/UncorrelatedFaultInjector.kt @@ -33,13 +33,14 @@ import kotlin.random.Random * A [FaultInjector] that injects uncorrelated faults into the system, meaning that failures of the subsystems are * independent. */ -public class UncorrelatedFaultInjector(private val mu: Double = 256.0, private val random: Random = Random.Default) : FaultInjector { +public class UncorrelatedFaultInjector(private val mu: Double = 1024.0, private val random: Random = Random.Default) : FaultInjector { /** * Enqueue the specified [FailureDomain] to fail some time in the future. */ override fun enqueue(domain: FailureDomain) { domain.scope.launch { - delay(random.expovariate(mu)) + val d = random.expovariate(mu) + delay(d) domain.fail() } } |
