summaryrefslogtreecommitdiff
path: root/simulator/opendc-runner-web
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-04-14 23:01:36 +0200
committerGitHub <noreply@github.com>2021-04-14 23:01:36 +0200
commit890dd87376f0d131292e3cdc685ab13192d11634 (patch)
tree4e27c85cf36609b2cf5881cfb696b05fbc65530a /simulator/opendc-runner-web
parentaf3546a9d658ccce0d59400a7218c8edf5a7ce5c (diff)
parent86b5df211938a8f9a391f143ccab5ccdf4a5d59e (diff)
harness: Fix issues with web runner (#117)
This pull request addresses several issues that were present in the web runner and the associated experiments: * Enable failures only when user requests it * Simplify power usage calculation (directly from J to Wh) * Fix issue with multiple socket machines. * Fix filter scheduler weights **Breaking API Changes** * `ScalingContext` now only exposes a `SimProcessingUnit` instead of a `ProcessingUnit` and `SimResourceSource`.
Diffstat (limited to 'simulator/opendc-runner-web')
-rw-r--r--simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/Main.kt6
-rw-r--r--simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/WebExperimentMonitor.kt2
2 files changed, 4 insertions, 4 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 90918f44..a368dfee 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
@@ -234,7 +234,7 @@ public class RunnerCli : CliktCommand(name = "runner") {
)
"mem-inv" -> FilterScheduler(
filters = listOf(ComputeFilter(), ComputeCapabilitiesFilter()),
- weighers = listOf(MemoryWeigher() to -1.0)
+ weighers = listOf(MemoryWeigher() to 1.0)
)
"core-mem" -> FilterScheduler(
filters = listOf(ComputeFilter(), ComputeCapabilitiesFilter()),
@@ -242,7 +242,7 @@ public class RunnerCli : CliktCommand(name = "runner") {
)
"core-mem-inv" -> FilterScheduler(
filters = listOf(ComputeFilter(), ComputeCapabilitiesFilter()),
- weighers = listOf(CoreMemoryWeigher() to -1.0)
+ weighers = listOf(CoreMemoryWeigher() to 1.0)
)
"active-servers" -> FilterScheduler(
filters = listOf(ComputeFilter(), ComputeCapabilitiesFilter()),
@@ -276,7 +276,7 @@ public class RunnerCli : CliktCommand(name = "runner") {
)
val topologyId = scenario.getEmbedded(listOf("topology", "topologyId"), ObjectId::class.java)
val environment = TopologyParser(topologies, topologyId)
- val failureFrequency = operational.get("failureFrequency", Number::class.java)?.toDouble() ?: 24.0 * 7
+ val failureFrequency = if (operational.getBoolean("failuresEnabled", false)) 24.0 * 7 else 0.0
withComputeService(clock, meterProvider, environment, allocationPolicy) { scheduler ->
val failureDomain = if (failureFrequency > 0) {
diff --git a/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/WebExperimentMonitor.kt b/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/WebExperimentMonitor.kt
index 8f39b8ac..c913f82f 100644
--- a/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/WebExperimentMonitor.kt
+++ b/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/WebExperimentMonitor.kt
@@ -84,7 +84,7 @@ public class WebExperimentMonitor : ExperimentMonitor {
hostAggregateMetrics.totalGrantedBurst + event.grantedBurst,
hostAggregateMetrics.totalOvercommittedBurst + event.overcommissionedBurst,
hostAggregateMetrics.totalInterferedBurst + event.interferedBurst,
- hostAggregateMetrics.totalPowerDraw + (slices * (event.powerDraw / 12)),
+ hostAggregateMetrics.totalPowerDraw + (event.duration * event.powerDraw) / 3600,
hostAggregateMetrics.totalFailureSlices + if (event.host.state != HostState.UP) slices else 0,
hostAggregateMetrics.totalFailureVmSlices + if (event.host.state != HostState.UP) event.vmCount * slices else 0
)