summaryrefslogtreecommitdiff
path: root/opendc-compute/opendc-compute-simulator/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-compute/opendc-compute-simulator/src/main')
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/host/HostModel.java2
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/telemetry/GuestCpuStats.java6
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/telemetry/HostCpuStats.java8
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/telemetry/HostSystemStats.java4
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/ComputeMetricReader.kt60
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/HostInfo.kt2
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/HostTableReader.kt16
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/TaskTableReader.kt2
8 files changed, 50 insertions, 50 deletions
diff --git a/opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/host/HostModel.java b/opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/host/HostModel.java
index 96236c5c..1ea73ea6 100644
--- a/opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/host/HostModel.java
+++ b/opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/host/HostModel.java
@@ -29,4 +29,4 @@ package org.opendc.compute.simulator.host;
* @param coreCount The number of logical processing cores available for this host.
* @param memoryCapacity The amount of memory available for this host in MB.
*/
-public record HostModel(float cpuCapacity, int coreCount, long memoryCapacity) {}
+public record HostModel(double cpuCapacity, int coreCount, long memoryCapacity) {}
diff --git a/opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/telemetry/GuestCpuStats.java b/opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/telemetry/GuestCpuStats.java
index ea37f5f2..97202104 100644
--- a/opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/telemetry/GuestCpuStats.java
+++ b/opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/telemetry/GuestCpuStats.java
@@ -38,6 +38,6 @@ public record GuestCpuStats(
long idleTime,
long stealTime,
long lostTime,
- float capacity,
- float usage,
- float utilization) {}
+ double capacity,
+ double usage,
+ double utilization) {}
diff --git a/opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/telemetry/HostCpuStats.java b/opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/telemetry/HostCpuStats.java
index 3f2aab78..4817690a 100644
--- a/opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/telemetry/HostCpuStats.java
+++ b/opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/telemetry/HostCpuStats.java
@@ -40,7 +40,7 @@ public record HostCpuStats(
long idleTime,
long stealTime,
long lostTime,
- float capacity,
- float demand,
- float usage,
- float utilization) {}
+ double capacity,
+ double demand,
+ double usage,
+ double utilization) {}
diff --git a/opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/telemetry/HostSystemStats.java b/opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/telemetry/HostSystemStats.java
index 353e62fa..aa292797 100644
--- a/opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/telemetry/HostSystemStats.java
+++ b/opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/telemetry/HostSystemStats.java
@@ -42,8 +42,8 @@ public record HostSystemStats(
Duration uptime,
Duration downtime,
Instant bootTime,
- float powerDraw,
- float energyUsage,
+ double powerDraw,
+ double energyUsage,
int guestsTerminated,
int guestsRunning,
int guestsError,
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 d5fb991d..c84b2a3f 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
@@ -340,21 +340,21 @@ public class ComputeMetricReader(
get() = _guestsInvalid
private var _guestsInvalid = 0
- override val cpuLimit: Float
+ override val cpuLimit: Double
get() = _cpuLimit
- private var _cpuLimit = 0.0f
+ private var _cpuLimit = 0.0
- override val cpuUsage: Float
+ override val cpuUsage: Double
get() = _cpuUsage
- private var _cpuUsage = 0.0f
+ private var _cpuUsage = 0.0
- override val cpuDemand: Float
+ override val cpuDemand: Double
get() = _cpuDemand
- private var _cpuDemand = 0.0f
+ private var _cpuDemand = 0.0
- override val cpuUtilization: Float
+ override val cpuUtilization: Double
get() = _cpuUtilization
- private var _cpuUtilization = 0.0f
+ private var _cpuUtilization = 0.0
override val cpuActiveTime: Long
get() = _cpuActiveTime - previousCpuActiveTime
@@ -376,22 +376,22 @@ public class ComputeMetricReader(
private var _cpuLostTime = 0L
private var previousCpuLostTime = 0L
- override val powerDraw: Float
+ override val powerDraw: Double
get() = _powerDraw
- private var _powerDraw = 0.0f
+ private var _powerDraw = 0.0
- override val energyUsage: Float
+ override val energyUsage: Double
get() = _energyUsage - previousEnergyUsage
- private var _energyUsage = 0.0f
- private var previousEnergyUsage = 0.0f
+ private var _energyUsage = 0.0
+ private var previousEnergyUsage = 0.0
- override val carbonIntensity: Float
+ override val carbonIntensity: Double
get() = _carbonIntensity
- private var _carbonIntensity = 0.0f
+ private var _carbonIntensity = 0.0
- override val carbonEmission: Float
+ override val carbonEmission: Double
get() = _carbonEmission
- private var _carbonEmission = 0.0f
+ private var _carbonEmission = 0.0
override val uptime: Long
get() = _uptime - previousUptime
@@ -437,7 +437,7 @@ public class ComputeMetricReader(
_energyUsage = hostSysStats.energyUsage
_carbonIntensity = carbonTrace.getCarbonIntensity(timestampAbsolute)
- _carbonEmission = carbonIntensity * (energyUsage / 3600000.0f) // convert energy usage from J to kWh
+ _carbonEmission = carbonIntensity * (energyUsage / 3600000.0) // convert energy usage from J to kWh
_uptime = hostSysStats.uptime.toMillis()
_downtime = hostSysStats.downtime.toMillis()
_bootTime = hostSysStats.bootTime
@@ -462,15 +462,15 @@ public class ComputeMetricReader(
_guestsError = 0
_guestsInvalid = 0
- _cpuLimit = 0.0f
- _cpuUsage = 0.0f
- _cpuDemand = 0.0f
- _cpuUtilization = 0.0f
+ _cpuLimit = 0.0
+ _cpuUsage = 0.0
+ _cpuDemand = 0.0
+ _cpuUtilization = 0.0
- _powerDraw = 0.0f
- _energyUsage = 0.0f
- _carbonIntensity = 0.0f
- _carbonEmission = 0.0f
+ _powerDraw = 0.0
+ _energyUsage = 0.0
+ _carbonIntensity = 0.0
+ _carbonEmission = 0.0
}
}
@@ -569,9 +569,9 @@ public class ComputeMetricReader(
get() = _finishTime
private var _finishTime: Instant? = null
- override val cpuLimit: Float
+ override val cpuLimit: Double
get() = _cpuLimit
- private var _cpuLimit = 0.0f
+ private var _cpuLimit = 0.0
override val cpuActiveTime: Long
get() = _cpuActiveTime - previousCpuActiveTime
@@ -625,7 +625,7 @@ public class ComputeMetricReader(
_timestamp = now
_timestampAbsolute = now + startTime
- _cpuLimit = cpuStats?.capacity ?: 0.0f
+ _cpuLimit = cpuStats?.capacity ?: 0.0
_cpuActiveTime = cpuStats?.activeTime ?: 0
_cpuIdleTime = cpuStats?.idleTime ?: 0
_cpuStealTime = cpuStats?.stealTime ?: 0
@@ -658,7 +658,7 @@ public class ComputeMetricReader(
previousCpuLostTime = _cpuLostTime
_host = null
- _cpuLimit = 0.0f
+ _cpuLimit = 0.0
}
}
}
diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/HostInfo.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/HostInfo.kt
index 1f1b9522..0220971b 100644
--- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/HostInfo.kt
+++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/HostInfo.kt
@@ -30,6 +30,6 @@ public data class HostInfo(
val name: String,
val arch: String,
val coreCount: Int,
- val coreSpeed: Float,
+ val coreSpeed: Double,
val memCapacity: Long,
)
diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/HostTableReader.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/HostTableReader.kt
index 5f09e7f5..a5a862ce 100644
--- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/HostTableReader.kt
+++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/HostTableReader.kt
@@ -71,22 +71,22 @@ public interface HostTableReader : Exportable {
/**
* The capacity of the CPUs in the host (in MHz).
*/
- public val cpuLimit: Float
+ public val cpuLimit: Double
/**
* The usage of all CPUs in the host (in MHz).
*/
- public val cpuUsage: Float
+ public val cpuUsage: Double
/**
* The demand of all vCPUs of the guests (in MHz)
*/
- public val cpuDemand: Float
+ public val cpuDemand: Double
/**
* The CPU utilization of the host.
*/
- public val cpuUtilization: Float
+ public val cpuUtilization: Double
/**
* The duration (in ms) that a CPU was active in the host.
@@ -111,22 +111,22 @@ public interface HostTableReader : Exportable {
/**
* The current power draw of the host in W.
*/
- public val powerDraw: Float
+ public val powerDraw: Double
/**
* The total energy consumption of the host since last sample in J.
*/
- public val energyUsage: Float
+ public val energyUsage: Double
/**
* The current carbon intensity of the host in gCO2 / kW.
*/
- public val carbonIntensity: Float
+ public val carbonIntensity: Double
/**
* The current carbon emission since the last deadline in g.
*/
- public val carbonEmission: Float
+ public val carbonEmission: Double
/**
* The uptime of the host since last time in ms.
diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/TaskTableReader.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/TaskTableReader.kt
index bc6a4edd..825019e8 100644
--- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/TaskTableReader.kt
+++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/table/TaskTableReader.kt
@@ -93,7 +93,7 @@ public interface TaskTableReader : Exportable {
/**
* The capacity of the CPUs of Host on which the task is running (in MHz).
*/
- public val cpuLimit: Float
+ public val cpuLimit: Double
/**
* The duration (in seconds) that a CPU was active in the task.