From 279f2a3e54c5b25b58e187a7c89bbddabe5b2724 Mon Sep 17 00:00:00 2001 From: Dante Niewenhuis Date: Thu, 7 Nov 2024 20:05:54 +0100 Subject: Fixed power source bug (#265) * Fixed a small bug making the power source not update energy usage properly * small update to the test --- .../org/opendc/compute/simulator/telemetry/ComputeMetricReader.kt | 2 -- .../src/main/kotlin/org/opendc/compute/topology/specs/TopologySpecs.kt | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'opendc-compute') diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/ComputeMetricReader.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/ComputeMetricReader.kt index 5dab5d7a..d5720649 100644 --- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/ComputeMetricReader.kt +++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/ComputeMetricReader.kt @@ -98,8 +98,6 @@ public class ComputeMetricReader( loggState() } } finally { - loggState() - if (monitor is AutoCloseable) { monitor.close() } diff --git a/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/specs/TopologySpecs.kt b/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/specs/TopologySpecs.kt index cdc1d96a..39b95347 100644 --- a/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/specs/TopologySpecs.kt +++ b/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/specs/TopologySpecs.kt @@ -151,7 +151,7 @@ public data class PowerSourceJSONSpec( public companion object { public val DFLT: PowerSourceJSONSpec = PowerSourceJSONSpec( - totalPower = 10000, + totalPower = Long.MAX_VALUE, ) } } -- cgit v1.2.3