diff options
Diffstat (limited to 'opendc/opendc-compute/src')
| -rw-r--r-- | opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/core/workload/PerformanceInterferenceModel.kt | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/core/workload/PerformanceInterferenceModel.kt b/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/core/workload/PerformanceInterferenceModel.kt index 45024a49..fab4ae9d 100644 --- a/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/core/workload/PerformanceInterferenceModel.kt +++ b/opendc/opendc-compute/src/main/kotlin/com/atlarge/opendc/compute/core/workload/PerformanceInterferenceModel.kt @@ -58,10 +58,20 @@ class PerformanceInterferenceModel( lhs.hashCode().compareTo(rhs.hashCode()) } val items = TreeSet(comparator) + val workloadToItem: Map<String, Set<PerformanceInterferenceModelItem>> private val colocatedWorkloads = TreeSet<String>() init { - this.items.addAll(items) + val workloadToItem = mutableMapOf<String, MutableSet<PerformanceInterferenceModelItem>>() + + for (item in items) { + for (workload in item.workloadNames) { + workloadToItem.getOrPut(workload) { mutableSetOf() }.add(item) + } + this.items.add(item) + } + + this.workloadToItem = workloadToItem } fun vmStarted(server: Server) { |
