summaryrefslogtreecommitdiff
path: root/opendc-compute
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-compute')
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt8
-rw-r--r--opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt16
-rw-r--r--opendc-compute/opendc-compute-telemetry/src/main/kotlin/org/opendc/compute/telemetry/export/parquet/ParquetHostDataWriter.kt4
-rw-r--r--opendc-compute/opendc-compute-telemetry/src/main/kotlin/org/opendc/compute/telemetry/export/parquet/ParquetServerDataWriter.kt6
-rw-r--r--opendc-compute/opendc-compute-telemetry/src/main/kotlin/org/opendc/compute/telemetry/export/parquet/ParquetServiceDataWriter.kt3
-rw-r--r--opendc-compute/opendc-compute-telemetry/src/main/kotlin/org/opendc/compute/telemetry/table/HostTableReader.kt8
6 files changed, 22 insertions, 23 deletions
diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt
index 461a33f0..16ded689 100644
--- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt
+++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt
@@ -248,10 +248,10 @@ public class SimHost(
counters.sync()
return HostCpuStats(
- counters.cpuActiveTime / 1000L,
- counters.cpuIdleTime / 1000L,
- counters.cpuStealTime / 1000L,
- counters.cpuLostTime / 1000L,
+ counters.cpuActiveTime,
+ counters.cpuIdleTime,
+ counters.cpuStealTime,
+ counters.cpuLostTime,
hypervisor.cpuCapacity,
hypervisor.cpuDemand,
hypervisor.cpuUsage,
diff --git a/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt b/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt
index 0f6618ad..e9bac8db 100644
--- a/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt
+++ b/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt
@@ -128,9 +128,9 @@ internal class SimHostTest {
val cpuStats = host.getCpuStats()
assertAll(
- { assertEquals(639, cpuStats.activeTime, "Active time does not match") },
- { assertEquals(2360, cpuStats.idleTime, "Idle time does not match") },
- { assertEquals(56, cpuStats.stealTime, "Steal time does not match") },
+ { assertEquals(639564, cpuStats.activeTime, "Active time does not match") },
+ { assertEquals(2360433, cpuStats.idleTime, "Idle time does not match") },
+ { assertEquals(56251, cpuStats.stealTime, "Steal time does not match") },
{ assertEquals(1499999, timeSource.millis()) }
)
}
@@ -215,9 +215,9 @@ internal class SimHostTest {
val cpuStats = host.getCpuStats()
assertAll(
- { assertEquals(658, cpuStats.activeTime, "Active time does not match") },
- { assertEquals(2341, cpuStats.idleTime, "Idle time does not match") },
- { assertEquals(637, cpuStats.stealTime, "Steal time does not match") },
+ { assertEquals(658502, cpuStats.activeTime, "Active time does not match") },
+ { assertEquals(2341496, cpuStats.idleTime, "Idle time does not match") },
+ { assertEquals(637504, cpuStats.stealTime, "Steal time does not match") },
{ assertEquals(1499999, timeSource.millis()) }
)
}
@@ -287,8 +287,8 @@ internal class SimHostTest {
val guestSysStats = host.getSystemStats(server)
assertAll(
- { assertEquals(1770, cpuStats.idleTime, "Idle time does not match") },
- { assertEquals(639, cpuStats.activeTime, "Active time does not match") },
+ { assertEquals(1770344, cpuStats.idleTime, "Idle time does not match") },
+ { assertEquals(639653, cpuStats.activeTime, "Active time does not match") },
{ assertEquals(1204999, sysStats.uptime.toMillis(), "Uptime does not match") },
{ assertEquals(300000, sysStats.downtime.toMillis(), "Downtime does not match") },
{ assertEquals(1204999, guestSysStats.uptime.toMillis(), "Guest uptime does not match") },
diff --git a/opendc-compute/opendc-compute-telemetry/src/main/kotlin/org/opendc/compute/telemetry/export/parquet/ParquetHostDataWriter.kt b/opendc-compute/opendc-compute-telemetry/src/main/kotlin/org/opendc/compute/telemetry/export/parquet/ParquetHostDataWriter.kt
index 8871570d..a6799ef8 100644
--- a/opendc-compute/opendc-compute-telemetry/src/main/kotlin/org/opendc/compute/telemetry/export/parquet/ParquetHostDataWriter.kt
+++ b/opendc-compute/opendc-compute-telemetry/src/main/kotlin/org/opendc/compute/telemetry/export/parquet/ParquetHostDataWriter.kt
@@ -170,7 +170,7 @@ public class ParquetHostDataWriter(path: File, bufferSize: Int) :
.addFields(
Types
.required(PrimitiveType.PrimitiveTypeName.INT64)
- .`as`(LogicalTypeAnnotation.timestampType(true, LogicalTypeAnnotation.TimeUnit.MILLIS))
+// .`as`(LogicalTypeAnnotation.timestampType(true, LogicalTypeAnnotation.TimeUnit.MILLIS))
.named("timestamp"),
Types
.required(PrimitiveType.PrimitiveTypeName.BINARY)
@@ -232,7 +232,7 @@ public class ParquetHostDataWriter(path: File, bufferSize: Int) :
.named("downtime"),
Types
.optional(PrimitiveType.PrimitiveTypeName.INT64)
- .`as`(LogicalTypeAnnotation.timestampType(true, LogicalTypeAnnotation.TimeUnit.MILLIS))
+// .`as`(LogicalTypeAnnotation.timestampType(true, LogicalTypeAnnotation.TimeUnit.MILLIS))
.named("boot_time")
)
.named("host")
diff --git a/opendc-compute/opendc-compute-telemetry/src/main/kotlin/org/opendc/compute/telemetry/export/parquet/ParquetServerDataWriter.kt b/opendc-compute/opendc-compute-telemetry/src/main/kotlin/org/opendc/compute/telemetry/export/parquet/ParquetServerDataWriter.kt
index 6645028e..e8a28016 100644
--- a/opendc-compute/opendc-compute-telemetry/src/main/kotlin/org/opendc/compute/telemetry/export/parquet/ParquetServerDataWriter.kt
+++ b/opendc-compute/opendc-compute-telemetry/src/main/kotlin/org/opendc/compute/telemetry/export/parquet/ParquetServerDataWriter.kt
@@ -152,7 +152,7 @@ public class ParquetServerDataWriter(path: File, bufferSize: Int) :
.addFields(
Types
.required(PrimitiveType.PrimitiveTypeName.INT64)
- .`as`(LogicalTypeAnnotation.timestampType(true, LogicalTypeAnnotation.TimeUnit.MILLIS))
+// .`as`(LogicalTypeAnnotation.timestampType(true, LogicalTypeAnnotation.TimeUnit.MILLIS))
.named("timestamp"),
Types
.required(PrimitiveType.PrimitiveTypeName.BINARY)
@@ -195,11 +195,11 @@ public class ParquetServerDataWriter(path: File, bufferSize: Int) :
.named("downtime"),
Types
.optional(PrimitiveType.PrimitiveTypeName.INT64)
- .`as`(LogicalTypeAnnotation.timestampType(true, LogicalTypeAnnotation.TimeUnit.MILLIS))
+// .`as`(LogicalTypeAnnotation.timestampType(true, LogicalTypeAnnotation.TimeUnit.MILLIS))
.named("provision_time"),
Types
.optional(PrimitiveType.PrimitiveTypeName.INT64)
- .`as`(LogicalTypeAnnotation.timestampType(true, LogicalTypeAnnotation.TimeUnit.MILLIS))
+// .`as`(LogicalTypeAnnotation.timestampType(true, LogicalTypeAnnotation.TimeUnit.MILLIS))
.named("boot_time")
)
diff --git a/opendc-compute/opendc-compute-telemetry/src/main/kotlin/org/opendc/compute/telemetry/export/parquet/ParquetServiceDataWriter.kt b/opendc-compute/opendc-compute-telemetry/src/main/kotlin/org/opendc/compute/telemetry/export/parquet/ParquetServiceDataWriter.kt
index 6908a018..a487203e 100644
--- a/opendc-compute/opendc-compute-telemetry/src/main/kotlin/org/opendc/compute/telemetry/export/parquet/ParquetServiceDataWriter.kt
+++ b/opendc-compute/opendc-compute-telemetry/src/main/kotlin/org/opendc/compute/telemetry/export/parquet/ParquetServiceDataWriter.kt
@@ -25,7 +25,6 @@ package org.opendc.compute.telemetry.export.parquet
import org.apache.hadoop.conf.Configuration
import org.apache.parquet.hadoop.api.WriteSupport
import org.apache.parquet.io.api.RecordConsumer
-import org.apache.parquet.schema.LogicalTypeAnnotation
import org.apache.parquet.schema.MessageType
import org.apache.parquet.schema.PrimitiveType
import org.apache.parquet.schema.Types
@@ -102,7 +101,7 @@ public class ParquetServiceDataWriter(path: File, bufferSize: Int) :
.addFields(
Types
.required(PrimitiveType.PrimitiveTypeName.INT64)
- .`as`(LogicalTypeAnnotation.timestampType(true, LogicalTypeAnnotation.TimeUnit.MILLIS))
+// .`as`(LogicalTypeAnnotation.timestampType(true, LogicalTypeAnnotation.TimeUnit.MILLIS))
.named("timestamp"),
Types
.required(PrimitiveType.PrimitiveTypeName.INT32)
diff --git a/opendc-compute/opendc-compute-telemetry/src/main/kotlin/org/opendc/compute/telemetry/table/HostTableReader.kt b/opendc-compute/opendc-compute-telemetry/src/main/kotlin/org/opendc/compute/telemetry/table/HostTableReader.kt
index 9af0a0c0..bfe2f281 100644
--- a/opendc-compute/opendc-compute-telemetry/src/main/kotlin/org/opendc/compute/telemetry/table/HostTableReader.kt
+++ b/opendc-compute/opendc-compute-telemetry/src/main/kotlin/org/opendc/compute/telemetry/table/HostTableReader.kt
@@ -84,22 +84,22 @@ public interface HostTableReader {
public val cpuUtilization: Double
/**
- * The duration (in seconds) that a CPU was active in the host.
+ * The duration (in ms) that a CPU was active in the host.
*/
public val cpuActiveTime: Long
/**
- * The duration (in seconds) that a CPU was idle in the host.
+ * The duration (in ms) that a CPU was idle in the host.
*/
public val cpuIdleTime: Long
/**
- * The duration (in seconds) that a vCPU wanted to run, but no capacity was available.
+ * The duration (in ms) that a vCPU wanted to run, but no capacity was available.
*/
public val cpuStealTime: Long
/**
- * The duration (in seconds) of CPU time that was lost due to interference.
+ * The duration (in ms) of CPU time that was lost due to interference.
*/
public val cpuLostTime: Long