summaryrefslogtreecommitdiff
path: root/opendc
diff options
context:
space:
mode:
authorGeorgios Andreadis <info@gandreadis.com>2020-03-11 16:17:39 +0100
committerGeorgios Andreadis <info@gandreadis.com>2020-03-11 16:17:39 +0100
commit5de05ebfbf46b7daabf0bd15a25ff7b5b9eb5aaa (patch)
treedfb0a83c7aa9b85de76364e44d3ac01b62466629 /opendc
parent224faa406b136e42b0406ab55425d382acc54fee (diff)
Make VM ID in trace reader random to allow for duplicates
Diffstat (limited to 'opendc')
-rw-r--r--opendc/opendc-core/src/main/kotlin/com/atlarge/opendc/core/workload/PerformanceInterferenceModel.kt2
-rw-r--r--opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20TraceReader.kt6
2 files changed, 4 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 5e0928b7..bc9b0b06 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
@@ -17,7 +17,7 @@ data class PerformanceInterferenceModel(
val items: Set<PerformanceInterferenceModelItem>
) {
fun apply(colocatedWorkloads: Set<Resource>): Double {
- val colocatedWorkloadIds = colocatedWorkloads.map { it.uid }
+ val colocatedWorkloadIds = colocatedWorkloads.map { it.name }
val intersectingItems = items.filter { item ->
colocatedWorkloadIds.intersect(item.workloadIds).size > 1
}
diff --git a/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20TraceReader.kt b/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20TraceReader.kt
index 70f56165..498f147f 100644
--- a/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20TraceReader.kt
+++ b/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20TraceReader.kt
@@ -57,7 +57,7 @@ class Sc20TraceReader(
* Initialize the reader.
*/
init {
- val entries = mutableMapOf<String, TraceEntry<VmWorkload>>()
+ val entries = mutableMapOf<UUID, TraceEntry<VmWorkload>>()
val timestampCol = 0
val cpuUsageCol = 1
@@ -122,7 +122,7 @@ class Sc20TraceReader(
}
}
- val uuid = UUID(0L, vmId.hashCode().toLong())
+ val uuid = UUID.randomUUID()
val relevantPerformanceInterferenceModelItems = PerformanceInterferenceModel(
performanceInterferenceModel.items.filter { it.workloadIds.contains(uuid) }.toSet()
@@ -139,7 +139,7 @@ class Sc20TraceReader(
requiredMemory
)
)
- entries[vmId] = TraceEntryImpl(
+ entries[uuid] = TraceEntryImpl(
flopsHistory.firstOrNull()?.tick ?: -1,
vmWorkload
)