summaryrefslogtreecommitdiff
path: root/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv
diff options
context:
space:
mode:
authorDante Niewenhuis <d.niewenhuis@hotmail.com>2024-04-17 18:17:17 +0200
committerGitHub <noreply@github.com>2024-04-17 18:17:17 +0200
commitd652fa2fa76556edd81d3b8087a0c943d462ec49 (patch)
tree072c2d033704452e44ebf44ea76943bc0f0f89e5 /opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv
parentfff89d25bd3c7b874e68261d21695c473c30ed7d (diff)
Added support for carbon traces (#218)
* Started with the carbon trace implementation * Moved the carbon trace system to the proper folders
Diffstat (limited to 'opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv')
-rw-r--r--opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/CarbonIntensityColumns.kt35
-rw-r--r--opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/ResourceColumns.kt6
-rw-r--r--opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/Tables.kt2
3 files changed, 43 insertions, 0 deletions
diff --git a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/CarbonIntensityColumns.kt b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/CarbonIntensityColumns.kt
new file mode 100644
index 00000000..de74c4fd
--- /dev/null
+++ b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/CarbonIntensityColumns.kt
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2022 AtLarge Research
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+@file:JvmName("CarbonIntensityColumns")
+
+package org.opendc.trace.conv
+
+/**
+ * A column containing the task identifier.
+ */
+public const val CARBON_INTENSITY_TIMESTAMP: String = "timestamp"
+
+/**
+ * A column containing the task identifier.
+ */
+public const val CARBON_INTENSITY_VALUE: String = "carbon_intensity"
diff --git a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/ResourceColumns.kt b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/ResourceColumns.kt
index 046dd13d..baaa0690 100644
--- a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/ResourceColumns.kt
+++ b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/ResourceColumns.kt
@@ -43,6 +43,12 @@ public val resourceClusterID: String = "cluster_id"
public val resourceStartTime: String = "start_time"
/**
+ * Start time for the resource.
+ */
+@JvmField
+public val resourceCarbonIntensity: String = "carbon_intensity"
+
+/**
* End time for the resource.
*/
@JvmField
diff --git a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/Tables.kt b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/Tables.kt
index 495628da..9b8fc6cf 100644
--- a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/Tables.kt
+++ b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/Tables.kt
@@ -48,3 +48,5 @@ public const val TABLE_RESOURCE_STATES: String = "resource_states"
* A table containing the groups of resources that interfere when run on the same execution platform.
*/
public const val TABLE_INTERFERENCE_GROUPS: String = "interference_groups"
+
+public const val TABLE_CARBON_INTENSITY: String = "carbon_intensities"