summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgios Andreadis <info@gandreadis.com>2020-04-11 11:10:27 +0200
committerGeorgios Andreadis <info@gandreadis.com>2020-04-11 11:10:27 +0200
commit751971d91c028fb19e20a2a424431da3f11a6713 (patch)
tree3cea5fe48d7d1e71439e1220716b46eec4fc354c
parent5310dd64606f398bddcaef87f26eee94b663b39d (diff)
Fix computation of VM interference set size
-rw-r--r--opendc/opendc-core/src/main/kotlin/com/atlarge/opendc/core/workload/PerformanceInterferenceModel.kt7
1 files changed, 3 insertions, 4 deletions
diff --git a/opendc/opendc-core/src/main/kotlin/com/atlarge/opendc/core/workload/PerformanceInterferenceModel.kt b/opendc/opendc-core/src/main/kotlin/com/atlarge/opendc/core/workload/PerformanceInterferenceModel.kt
index ea110934..1efe7588 100644
--- a/opendc/opendc-core/src/main/kotlin/com/atlarge/opendc/core/workload/PerformanceInterferenceModel.kt
+++ b/opendc/opendc-core/src/main/kotlin/com/atlarge/opendc/core/workload/PerformanceInterferenceModel.kt
@@ -31,12 +31,11 @@ data class PerformanceInterferenceModel(
}
val score = intersectingItems
.filter { it.minServerLoad <= currentServerLoad }
- .map { it.performanceScore }
- .min()
+ .minBy { it.performanceScore }
// Apply performance penalty to (on average) only one of the VMs
- return if (score != null && Random.nextInt(items.size) == 0) {
- score
+ return if (score != null && Random.nextInt(score.workloadNames.size) == 0) {
+ score.performanceScore
} else {
1.0
}