From 224faa406b136e42b0406ab55425d382acc54fee Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Wed, 11 Mar 2020 16:11:43 +0100 Subject: feat: Pass all relevant SC20 parameters as arguments This also includes a list of selected VMs, with the aim of only running those (for workload intensity sampling). --- .../opendc/format/trace/sc20/Sc20TraceReader.kt | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'opendc/opendc-format/src') 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 d4656823..70f56165 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 @@ -45,7 +45,8 @@ import java.util.UUID */ class Sc20TraceReader( traceDirectory: File, - performanceInterferenceModel: PerformanceInterferenceModel + performanceInterferenceModel: PerformanceInterferenceModel, + selectedVms: List ) : TraceReader { /** * The internal iterator to use for this reader. @@ -65,9 +66,18 @@ class Sc20TraceReader( val provisionedMemoryCol = 20 val traceInterval = 5 * 60 * 1000L - traceDirectory.walk() - .filterNot { it.isDirectory } - .filter { it.extension == "csv" || it.extension == "txt" } + val vms = if (selectedVms.isEmpty()) { + traceDirectory.walk() + .filterNot { it.isDirectory } + .filter { it.extension == "csv" || it.extension == "txt" } + .toList() + } else { + selectedVms.map { + File(traceDirectory, it) + } + } + + vms .forEach { vmFile -> println(vmFile) val flopsHistory = mutableListOf() -- cgit v1.2.3 From 5de05ebfbf46b7daabf0bd15a25ff7b5b9eb5aaa Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Wed, 11 Mar 2020 16:17:39 +0100 Subject: Make VM ID in trace reader random to allow for duplicates --- .../kotlin/com/atlarge/opendc/format/trace/sc20/Sc20TraceReader.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'opendc/opendc-format/src') 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>() + val entries = mutableMapOf>() 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 ) -- cgit v1.2.3