diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-05-23 16:24:05 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-05-23 16:24:05 +0200 |
| commit | ebcacf96fbc1cd16a91523f95dd01db046fb7f90 (patch) | |
| tree | e40d28015796c81dc80ef211a875cca4662a5642 /opendc/opendc-core | |
| parent | 128ee618c81820f5d44f5d309a5b222bf0787acd (diff) | |
| parent | e05aba274accc6006ffb2fb3fccc1d4399b4c4a0 (diff) | |
Merge branch '2.x-update-total-load' into '2.x'
Update total load to match filtered VM set
See merge request opendc/opendc-simulator!71
Diffstat (limited to 'opendc/opendc-core')
| -rw-r--r-- | opendc/opendc-core/src/main/kotlin/com/atlarge/opendc/core/failure/CorrelatedFaultInjector.kt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/opendc/opendc-core/src/main/kotlin/com/atlarge/opendc/core/failure/CorrelatedFaultInjector.kt b/opendc/opendc-core/src/main/kotlin/com/atlarge/opendc/core/failure/CorrelatedFaultInjector.kt index 2904fbec..50261db5 100644 --- a/opendc/opendc-core/src/main/kotlin/com/atlarge/opendc/core/failure/CorrelatedFaultInjector.kt +++ b/opendc/opendc-core/src/main/kotlin/com/atlarge/opendc/core/failure/CorrelatedFaultInjector.kt @@ -31,6 +31,7 @@ import kotlinx.coroutines.delay import kotlinx.coroutines.ensureActive import kotlinx.coroutines.launch import kotlin.math.exp +import kotlin.math.max import kotlin.random.Random import kotlin.random.asJavaRandom @@ -107,7 +108,7 @@ public class CorrelatedFaultInjector( failureDomain.fail() } - val df = lognvariate(dScale, dShape) * 6e4 + val df = max(lognvariate(dScale, dShape) * 6e4, 15 * 6e4) // Handle long overflow if (simulationContext.clock.millis() + df <= 0) { |
