summaryrefslogtreecommitdiff
path: root/opendc-trace/opendc-trace-api/src
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-09-01 22:30:39 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-09-02 11:30:16 +0200
commit8bae0f3053a53aac9d483ae97d99f2e7e80b42ef (patch)
tree293350c299b9d38ea05abf3a854715a26e69d0f4 /opendc-trace/opendc-trace-api/src
parentb2308e1077dc60ec6a4dc646613a4be5b59695a6 (diff)
refactor(capelin): Migrate trace reader to new trace API
This change updates the trace reading classes in the Capelin experiment to use the new trace API in order to re-use many of the trace reading parts.
Diffstat (limited to 'opendc-trace/opendc-trace-api/src')
-rw-r--r--opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/ResourceColumns.kt22
-rw-r--r--opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/ResourceStateColumns.kt26
2 files changed, 48 insertions, 0 deletions
diff --git a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/ResourceColumns.kt b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/ResourceColumns.kt
index 65055762..8945823a 100644
--- a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/ResourceColumns.kt
+++ b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/ResourceColumns.kt
@@ -23,7 +23,29 @@
@file:JvmName("ResourceColumns")
package org.opendc.trace
+import java.time.Instant
+
/**
* Identifier of the resource.
*/
public val RESOURCE_ID: TableColumn<String> = stringColumn("resource:id")
+
+/**
+ * Start time for the resource.
+ */
+public val RESOURCE_START_TIME: TableColumn<Instant> = TableColumn("resource:start_time", Instant::class.java)
+
+/**
+ * End time for the resource.
+ */
+public val RESOURCE_END_TIME: TableColumn<Instant> = TableColumn("resource:end_time", Instant::class.java)
+
+/**
+ * Number of CPUs for the resource.
+ */
+public val RESOURCE_NCPUS: TableColumn<Int> = intColumn("resource:num_cpus")
+
+/**
+ * Memory capacity for the resource.
+ */
+public val RESOURCE_MEM_CAPACITY: TableColumn<Double> = doubleColumn("resource:mem_capacity")
diff --git a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/ResourceStateColumns.kt b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/ResourceStateColumns.kt
index 17f52ab6..c2d896a8 100644
--- a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/ResourceStateColumns.kt
+++ b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/ResourceStateColumns.kt
@@ -23,6 +23,7 @@
@file:JvmName("ResourceStateColumns")
package org.opendc.trace
+import java.time.Duration
import java.time.Instant
/**
@@ -31,11 +32,26 @@ import java.time.Instant
public val RESOURCE_STATE_ID: TableColumn<String> = stringColumn("resource_state:id")
/**
+ * The cluster to which the resource belongs.
+ */
+public val RESOURCE_STATE_CLUSTER_ID: TableColumn<String> = stringColumn("resource_state:cluster_id")
+
+/**
* Timestamp for the state.
*/
public val RESOURCE_STATE_TIMESTAMP: TableColumn<Instant> = TableColumn("resource_state:timestamp", Instant::class.java)
/**
+ * Duration for the state.
+ */
+public val RESOURCE_STATE_DURATION: TableColumn<Duration> = TableColumn("resource_state:duration", Duration::class.java)
+
+/**
+ * A flag to indicate that the resource is powered on.
+ */
+public val RESOURCE_STATE_POWERED_ON: TableColumn<Boolean> = booleanColumn("resource_state:powered_on")
+
+/**
* Number of CPUs for the resource.
*/
public val RESOURCE_STATE_NCPUS: TableColumn<Int> = intColumn("resource_state:ncpus")
@@ -56,6 +72,16 @@ public val RESOURCE_STATE_CPU_USAGE: TableColumn<Double> = doubleColumn("resourc
public val RESOURCE_STATE_CPU_USAGE_PCT: TableColumn<Double> = doubleColumn("resource_state:cpu_usage_pct")
/**
+ * Total CPU demand of the resource in MHz.
+ */
+public val RESOURCE_STATE_CPU_DEMAND: TableColumn<Double> = doubleColumn("resource_state:cpu_demand")
+
+/**
+ * CPU ready percentage.
+ */
+public val RESOURCE_STATE_CPU_READY_PCT: TableColumn<Double> = doubleColumn("resource_state:cpu_ready_pct")
+
+/**
* Memory capacity of the resource in KB.
*/
public val RESOURCE_STATE_MEM_CAPACITY: TableColumn<Double> = doubleColumn("resource_state:mem_capacity")