summaryrefslogtreecommitdiff
path: root/simulator/opendc-runner-web/src
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2020-10-29 21:16:13 +0100
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-10-29 21:16:13 +0100
commit40fcd37fb5eb8ea33b7dea95d45cc73018ea22b8 (patch)
tree58c8806ac03939cfeb0120daaf7684c9b3ef8191 /simulator/opendc-runner-web/src
parented9ac9fefe00a0f0945a1b80fdb6cb364c67a073 (diff)
Support non-ObjectIds and empty traces
Diffstat (limited to 'simulator/opendc-runner-web/src')
-rw-r--r--simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/Main.kt1
-rw-r--r--simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/ResultProcessor.kt57
-rw-r--r--simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/TopologyParser.kt2
-rw-r--r--simulator/opendc-runner-web/src/main/resources/log4j2.xml4
4 files changed, 43 insertions, 21 deletions
diff --git a/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/Main.kt b/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/Main.kt
index d21d000b..0b96db3d 100644
--- a/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/Main.kt
+++ b/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/Main.kt
@@ -293,6 +293,7 @@ public class RunnerCli : CliktCommand(name = "runner") {
try {
testScope.advanceUntilIdle()
+ testScope.uncaughtExceptions.forEach { it.printStackTrace() }
} finally {
monitor.close()
}
diff --git a/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/ResultProcessor.kt b/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/ResultProcessor.kt
index 979e5d3c..7f122cf7 100644
--- a/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/ResultProcessor.kt
+++ b/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/ResultProcessor.kt
@@ -47,25 +47,46 @@ public class ResultProcessor(private val master: String, private val outputPath:
try {
val hostMetrics = spark.read().parquet(File(outputPath, "host-metrics/scenario_id=$id").path)
val provisionerMetrics = spark.read().parquet(File(outputPath, "provisioner-metrics/scenario_id=$id").path)
- val res = aggregate(hostMetrics, provisionerMetrics).first()
+ val res = aggregate(hostMetrics, provisionerMetrics).collectAsList()
- return Result(
- res.getList<Long>(1),
- res.getList<Long>(2),
- res.getList<Long>(3),
- res.getList<Long>(4),
- res.getList<Double>(5),
- res.getList<Double>(6),
- res.getList<Double>(7),
- res.getList<Int>(8),
- res.getList<Long>(9),
- res.getList<Long>(10),
- res.getList<Long>(11),
- res.getList<Int>(12),
- res.getList<Int>(13),
- res.getList<Int>(14),
- res.getList<Int>(15)
- )
+ if (res.isEmpty()) {
+ return Result(
+ emptyList(),
+ emptyList(),
+ emptyList(),
+ emptyList(),
+ emptyList(),
+ emptyList(),
+ emptyList(),
+ emptyList(),
+ emptyList(),
+ emptyList(),
+ emptyList(),
+ emptyList(),
+ emptyList(),
+ emptyList(),
+ emptyList()
+ )
+ } else {
+ val head = res.first()
+ return Result(
+ head.getList<Long>(1),
+ head.getList<Long>(2),
+ head.getList<Long>(3),
+ head.getList<Long>(4),
+ head.getList<Double>(5),
+ head.getList<Double>(6),
+ head.getList<Double>(7),
+ head.getList<Int>(8),
+ head.getList<Long>(9),
+ head.getList<Long>(10),
+ head.getList<Long>(11),
+ head.getList<Int>(12),
+ head.getList<Int>(13),
+ head.getList<Int>(14),
+ head.getList<Int>(15)
+ )
+ }
} finally {
spark.close()
}
diff --git a/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/TopologyParser.kt b/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/TopologyParser.kt
index 0d1e96e6..80bd20f7 100644
--- a/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/TopologyParser.kt
+++ b/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/TopologyParser.kt
@@ -61,7 +61,7 @@ public class TopologyParser(private val collection: MongoCollection<Document>, p
val random = Random(0)
for (machine in fetchMachines(id)) {
- val clusterId = machine.getObjectId("rack_id")
+ val clusterId = machine.get("rack_id").toString()
val position = machine.getInteger("position")
val processors = machine.getList("cpus", Document::class.java).flatMap { cpu ->
diff --git a/simulator/opendc-runner-web/src/main/resources/log4j2.xml b/simulator/opendc-runner-web/src/main/resources/log4j2.xml
index 16cedf34..ffc39890 100644
--- a/simulator/opendc-runner-web/src/main/resources/log4j2.xml
+++ b/simulator/opendc-runner-web/src/main/resources/log4j2.xml
@@ -30,7 +30,7 @@
</Console>
</Appenders>
<Loggers>
- <Logger name="org.opendc" level="warn" additivity="false">
+ <Logger name="org.opendc" level="info" additivity="false">
<AppenderRef ref="Console"/>
</Logger>
<Logger name="org.opendc.runner" level="info" additivity="false">
@@ -39,7 +39,7 @@
<Logger name="org.apache.hadoop" level="warn" additivity="false">
<AppenderRef ref="Console"/>
</Logger>
- <Logger name="org.apache.spark" level="info" additivity="false">
+ <Logger name="org.apache.spark" level="warn" additivity="false">
<AppenderRef ref="Console"/>
</Logger>
<Root level="error">