summaryrefslogtreecommitdiff
path: root/opendc/opendc-format
diff options
context:
space:
mode:
authorGeorgios Andreadis <info@gandreadis.com>2020-03-11 16:11:43 +0100
committerGeorgios Andreadis <info@gandreadis.com>2020-03-11 16:11:43 +0100
commit224faa406b136e42b0406ab55425d382acc54fee (patch)
tree1f23f1970cfde81b80e925ce42dfb7fad5ddb96b /opendc/opendc-format
parent0655127dcd945289f045d8e04304e6a050e2a2f9 (diff)
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).
Diffstat (limited to 'opendc/opendc-format')
-rw-r--r--opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20TraceReader.kt18
1 files changed, 14 insertions, 4 deletions
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<String>
) : TraceReader<VmWorkload> {
/**
* 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<FlopsHistoryFragment>()