From 47357afd16f928260db34d4dd3e686fb9ee7c5ff Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Thu, 6 Oct 2022 13:13:10 +0200 Subject: build: Switch to Spotless for formatting This change updates the build configuration to use Spotless for code formating of both Kotlin and Java. --- .../opendc-web-runner/src/cli/kotlin/org/opendc/web/runner/Main.kt | 2 +- .../src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt | 7 ++++--- .../kotlin/org/opendc/web/runner/internal/WebComputeMonitor.kt | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) (limited to 'opendc-web/opendc-web-runner') diff --git a/opendc-web/opendc-web-runner/src/cli/kotlin/org/opendc/web/runner/Main.kt b/opendc-web/opendc-web-runner/src/cli/kotlin/org/opendc/web/runner/Main.kt index 56fecf78..299c4d09 100644 --- a/opendc-web/opendc-web-runner/src/cli/kotlin/org/opendc/web/runner/Main.kt +++ b/opendc-web/opendc-web-runner/src/cli/kotlin/org/opendc/web/runner/Main.kt @@ -109,7 +109,7 @@ class RunnerCli : CliktCommand(name = "opendc-runner") { */ private val parallelism by option( "--parallelism", - help = "maximum number of threads for simulations", + help = "maximum number of threads for simulations" ) .int() .default(Runtime.getRuntime().availableProcessors() - 1) diff --git a/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt b/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt index b0f99084..226bad47 100644 --- a/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt +++ b/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt @@ -215,7 +215,7 @@ public class OpenDCRunner( private inner class SimulationTask( private val scenario: Scenario, private val repeat: Int, - private val topology: List, + private val topology: List ) : RecursiveTask() { override fun compute(): WebComputeMonitor.Results { val monitor = WebComputeMonitor() @@ -261,10 +261,11 @@ public class OpenDCRunner( val phenomena = scenario.phenomena val failureModel = - if (phenomena.failures) + if (phenomena.failures) { grid5000(Duration.ofDays(7)) - else + } else { null + } // Run workload trace service.replay(clock, vms, seed, failureModel = failureModel, interference = phenomena.interference) diff --git a/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/internal/WebComputeMonitor.kt b/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/internal/WebComputeMonitor.kt index 76377c08..4db70d3d 100644 --- a/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/internal/WebComputeMonitor.kt +++ b/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/internal/WebComputeMonitor.kt @@ -66,7 +66,7 @@ internal class WebComputeMonitor : ComputeMonitor { val totalLostTime: Long = 0L, val totalPowerDraw: Double = 0.0, val totalFailureSlices: Double = 0.0, - val totalFailureVmSlices: Double = 0.0, + val totalFailureVmSlices: Double = 0.0 ) private data class HostMetrics( @@ -84,7 +84,7 @@ internal class WebComputeMonitor : ComputeMonitor { max(reader.serversPending, serviceMetrics.vmWaitingCount), max(reader.serversActive, serviceMetrics.vmActiveCount), max(0, serviceMetrics.vmInactiveCount), - max(reader.attemptsFailure, serviceMetrics.vmFailedCount), + max(reader.attemptsFailure, serviceMetrics.vmFailedCount) ) } @@ -115,7 +115,7 @@ internal class WebComputeMonitor : ComputeMonitor { serviceMetrics.vmTotalCount, serviceMetrics.vmWaitingCount, serviceMetrics.vmInactiveCount, - serviceMetrics.vmFailedCount, + serviceMetrics.vmFailedCount ) } -- cgit v1.2.3