From 938f60832d6a500fee74b5f44838287c5432a74e Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Thu, 14 Apr 2022 15:26:22 +0200 Subject: feat(trace/opendc): Incorporate interference model in trace format This change updates the OpenDC VM trace format to incorporate the VM interference model in the trace format itself. This makes sense since the model is tightly coupled to the actual trace that is being simulated. This approach has as benefit that we can directly load the interference model from the workload trace, without having to resolve the model seperately (as we did before). --- .../org/opendc/trace/InterferenceGroupColumns.kt | 42 ++++++++++++++++++++++ .../src/main/kotlin/org/opendc/trace/Tables.kt | 5 +++ 2 files changed, 47 insertions(+) create mode 100644 opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/InterferenceGroupColumns.kt (limited to 'opendc-trace/opendc-trace-api/src') diff --git a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/InterferenceGroupColumns.kt b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/InterferenceGroupColumns.kt new file mode 100644 index 00000000..81758e5f --- /dev/null +++ b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/InterferenceGroupColumns.kt @@ -0,0 +1,42 @@ +/* + * 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("InterferenceGroupColumns") +package org.opendc.trace + +/** + * Members of the interference group. + */ +@JvmField +public val INTERFERENCE_GROUP_MEMBERS: TableColumn> = column("interference_group:members") + +/** + * Target load after which the interference occurs. + */ +@JvmField +public val INTERFERENCE_GROUP_TARGET: TableColumn = column("interference_group:target") + +/** + * Performance score when the interference occurs. + */ +@JvmField +public val INTERFERENCE_GROUP_SCORE: TableColumn = column("interference_group:score") diff --git a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/Tables.kt b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/Tables.kt index bb9d93e2..0d9c2b74 100644 --- a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/Tables.kt +++ b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/Tables.kt @@ -42,3 +42,8 @@ public const val TABLE_RESOURCES: String = "resources" * A table containing all resource states in a workload. */ 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" -- cgit v1.2.3 From b6698d96fb1313909705604be2daf1170ea40d68 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Sat, 16 Apr 2022 11:32:28 +0200 Subject: refactor(trace/api): Move conventions into separate package This change moves the trace conventions (such as table and column names) in a separate conv package, so that it is separated from the main API. This also allows for a potential move into a separate module in the future. --- .../org/opendc/trace/InterferenceGroupColumns.kt | 42 --------- .../kotlin/org/opendc/trace/ResourceColumns.kt | 68 -------------- .../org/opendc/trace/ResourceStateColumns.kt | 99 -------------------- .../main/kotlin/org/opendc/trace/TableColumns.kt | 34 ------- .../src/main/kotlin/org/opendc/trace/Tables.kt | 49 ---------- .../main/kotlin/org/opendc/trace/TaskColumns.kt | 99 -------------------- .../opendc/trace/conv/InterferenceGroupColumns.kt | 45 +++++++++ .../org/opendc/trace/conv/ResourceColumns.kt | 70 ++++++++++++++ .../org/opendc/trace/conv/ResourceStateColumns.kt | 101 +++++++++++++++++++++ .../kotlin/org/opendc/trace/conv/TableColumns.kt | 34 +++++++ .../main/kotlin/org/opendc/trace/conv/Tables.kt | 49 ++++++++++ .../kotlin/org/opendc/trace/conv/TaskColumns.kt | 101 +++++++++++++++++++++ 12 files changed, 400 insertions(+), 391 deletions(-) delete mode 100644 opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/InterferenceGroupColumns.kt delete mode 100644 opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/ResourceColumns.kt delete mode 100644 opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/ResourceStateColumns.kt delete mode 100644 opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/TableColumns.kt delete mode 100644 opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/Tables.kt delete mode 100644 opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/TaskColumns.kt create mode 100644 opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/InterferenceGroupColumns.kt create mode 100644 opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/ResourceColumns.kt create mode 100644 opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/ResourceStateColumns.kt create mode 100644 opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/TableColumns.kt create mode 100644 opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/Tables.kt create mode 100644 opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/TaskColumns.kt (limited to 'opendc-trace/opendc-trace-api/src') diff --git a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/InterferenceGroupColumns.kt b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/InterferenceGroupColumns.kt deleted file mode 100644 index 81758e5f..00000000 --- a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/InterferenceGroupColumns.kt +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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("InterferenceGroupColumns") -package org.opendc.trace - -/** - * Members of the interference group. - */ -@JvmField -public val INTERFERENCE_GROUP_MEMBERS: TableColumn> = column("interference_group:members") - -/** - * Target load after which the interference occurs. - */ -@JvmField -public val INTERFERENCE_GROUP_TARGET: TableColumn = column("interference_group:target") - -/** - * Performance score when the interference occurs. - */ -@JvmField -public val INTERFERENCE_GROUP_SCORE: TableColumn = column("interference_group:score") 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 deleted file mode 100644 index f1977945..00000000 --- a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/ResourceColumns.kt +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2021 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("ResourceColumns") -package org.opendc.trace - -import java.time.Instant - -/** - * Identifier of the resource. - */ -@JvmField -public val RESOURCE_ID: TableColumn = column("resource:id") - -/** - * The cluster to which the resource belongs. - */ -@JvmField -public val RESOURCE_CLUSTER_ID: TableColumn = column("resource:cluster_id") - -/** - * Start time for the resource. - */ -@JvmField -public val RESOURCE_START_TIME: TableColumn = column("resource:start_time") - -/** - * End time for the resource. - */ -@JvmField -public val RESOURCE_STOP_TIME: TableColumn = column("resource:stop_time") - -/** - * Number of CPUs for the resource. - */ -@JvmField -public val RESOURCE_CPU_COUNT: TableColumn = column("resource:cpu_count") - -/** - * Total CPU capacity of the resource in MHz. - */ -@JvmField -public val RESOURCE_CPU_CAPACITY: TableColumn = column("resource:cpu_capacity") - -/** - * Memory capacity for the resource in KB. - */ -@JvmField -public val RESOURCE_MEM_CAPACITY: TableColumn = column("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 deleted file mode 100644 index 244352ae..00000000 --- a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/ResourceStateColumns.kt +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2021 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("ResourceStateColumns") -package org.opendc.trace - -import java.time.Duration -import java.time.Instant - -/** - * The timestamp at which the state was recorded. - */ -@JvmField -public val RESOURCE_STATE_TIMESTAMP: TableColumn = column("resource_state:timestamp") - -/** - * Duration for the state. - */ -@JvmField -public val RESOURCE_STATE_DURATION: TableColumn = column("resource_state:duration") - -/** - * A flag to indicate that the resource is powered on. - */ -@JvmField -public val RESOURCE_STATE_POWERED_ON: TableColumn = column("resource_state:powered_on") - -/** - * Total CPU usage of the resource in MHz. - */ -@JvmField -public val RESOURCE_STATE_CPU_USAGE: TableColumn = column("resource_state:cpu_usage") - -/** - * Total CPU usage of the resource in percentage. - */ -@JvmField -public val RESOURCE_STATE_CPU_USAGE_PCT: TableColumn = column("resource_state:cpu_usage_pct") - -/** - * Total CPU demand of the resource in MHz. - */ -@JvmField -public val RESOURCE_STATE_CPU_DEMAND: TableColumn = column("resource_state:cpu_demand") - -/** - * CPU ready percentage. - */ -@JvmField -public val RESOURCE_STATE_CPU_READY_PCT: TableColumn = column("resource_state:cpu_ready_pct") - -/** - * Memory usage of the resource in KB. - */ -@JvmField -public val RESOURCE_STATE_MEM_USAGE: TableColumn = column("resource_state:mem_usage") - -/** - * Disk read throughput of the resource in KB/s. - */ -@JvmField -public val RESOURCE_STATE_DISK_READ: TableColumn = column("resource_state:disk_read") - -/** - * Disk write throughput of the resource in KB/s. - */ -@JvmField -public val RESOURCE_STATE_DISK_WRITE: TableColumn = column("resource_state:disk_write") - -/** - * Network receive throughput of the resource in KB/s. - */ -@JvmField -public val RESOURCE_STATE_NET_RX: TableColumn = column("resource_state:net_rx") - -/** - * Network transmit throughput of the resource in KB/s. - */ -@JvmField -public val RESOURCE_STATE_NET_TX: TableColumn = column("resource_state:net_tx") diff --git a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/TableColumns.kt b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/TableColumns.kt deleted file mode 100644 index 31a58360..00000000 --- a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/TableColumns.kt +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 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("TableColumns") -package org.opendc.trace - -/** - * Construct a [TableColumn] with the specified [name] and type [T]. - */ -public inline fun column(name: String): TableColumn = column(name, T::class.java) - -/** - * Construct a [TableColumn] with the specified [name] and [type]. - */ -public fun column(name: String, type: Class): TableColumn = TableColumn(name, type) diff --git a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/Tables.kt b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/Tables.kt deleted file mode 100644 index 0d9c2b74..00000000 --- a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/Tables.kt +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2021 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("Tables") -package org.opendc.trace - -/** - * A table containing all workflows in a workload. - */ -public const val TABLE_WORKFLOWS: String = "workflows" - -/** - * A table containing all tasks in a workload. - */ -public const val TABLE_TASKS: String = "tasks" - -/** - * A table containing all resources in a workload. - */ -public const val TABLE_RESOURCES: String = "resources" - -/** - * A table containing all resource states in a workload. - */ -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" diff --git a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/TaskColumns.kt b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/TaskColumns.kt deleted file mode 100644 index d103bce4..00000000 --- a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/TaskColumns.kt +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2021 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("TaskColumns") -package org.opendc.trace - -import java.time.Duration -import java.time.Instant - -/** - * A column containing the task identifier. - */ -@JvmField -public val TASK_ID: TableColumn = column("task:id") - -/** - * A column containing the identifier of the workflow. - */ -@JvmField -public val TASK_WORKFLOW_ID: TableColumn = column("task:workflow_id") - -/** - * A column containing the submission time of the task. - */ -@JvmField -public val TASK_SUBMIT_TIME: TableColumn = column("task:submit_time") - -/** - * A column containing the wait time of the task. - */ -@JvmField -public val TASK_WAIT_TIME: TableColumn = column("task:wait_time") - -/** - * A column containing the runtime time of the task. - */ -@JvmField -public val TASK_RUNTIME: TableColumn = column("task:runtime") - -/** - * A column containing the parents of a task. - */ -@JvmField -public val TASK_PARENTS: TableColumn> = column("task:parents") - -/** - * A column containing the children of a task. - */ -@JvmField -public val TASK_CHILDREN: TableColumn> = column("task:children") - -/** - * A column containing the requested CPUs of a task. - */ -@JvmField -public val TASK_REQ_NCPUS: TableColumn = column("task:req_ncpus") - -/** - * A column containing the allocated CPUs of a task. - */ -@JvmField -public val TASK_ALLOC_NCPUS: TableColumn = column("task:alloc_ncpus") - -/** - * A column containing the status of a task. - */ -@JvmField -public val TASK_STATUS: TableColumn = column("task:status") - -/** - * A column containing the group id of a task. - */ -@JvmField -public val TASK_GROUP_ID: TableColumn = column("task:group_id") - -/** - * A column containing the user id of a task. - */ -@JvmField -public val TASK_USER_ID: TableColumn = column("task:user_id") diff --git a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/InterferenceGroupColumns.kt b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/InterferenceGroupColumns.kt new file mode 100644 index 00000000..532f6d24 --- /dev/null +++ b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/InterferenceGroupColumns.kt @@ -0,0 +1,45 @@ +/* + * 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("InterferenceGroupColumns") +package org.opendc.trace.conv + +import org.opendc.trace.TableColumn +import org.opendc.trace.column + +/** + * Members of the interference group. + */ +@JvmField +public val INTERFERENCE_GROUP_MEMBERS: TableColumn> = column("interference_group:members") + +/** + * Target load after which the interference occurs. + */ +@JvmField +public val INTERFERENCE_GROUP_TARGET: TableColumn = column("interference_group:target") + +/** + * Performance score when the interference occurs. + */ +@JvmField +public val INTERFERENCE_GROUP_SCORE: TableColumn = column("interference_group:score") 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 new file mode 100644 index 00000000..e9fc5d44 --- /dev/null +++ b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/ResourceColumns.kt @@ -0,0 +1,70 @@ +/* + * 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("ResourceColumns") +package org.opendc.trace.conv + +import org.opendc.trace.TableColumn +import org.opendc.trace.column +import java.time.Instant + +/** + * Identifier of the resource. + */ +@JvmField +public val RESOURCE_ID: TableColumn = column("resource:id") + +/** + * The cluster to which the resource belongs. + */ +@JvmField +public val RESOURCE_CLUSTER_ID: TableColumn = column("resource:cluster_id") + +/** + * Start time for the resource. + */ +@JvmField +public val RESOURCE_START_TIME: TableColumn = column("resource:start_time") + +/** + * End time for the resource. + */ +@JvmField +public val RESOURCE_STOP_TIME: TableColumn = column("resource:stop_time") + +/** + * Number of CPUs for the resource. + */ +@JvmField +public val RESOURCE_CPU_COUNT: TableColumn = column("resource:cpu_count") + +/** + * Total CPU capacity of the resource in MHz. + */ +@JvmField +public val RESOURCE_CPU_CAPACITY: TableColumn = column("resource:cpu_capacity") + +/** + * Memory capacity for the resource in KB. + */ +@JvmField +public val RESOURCE_MEM_CAPACITY: TableColumn = column("resource:mem_capacity") diff --git a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/ResourceStateColumns.kt b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/ResourceStateColumns.kt new file mode 100644 index 00000000..d5bbafd7 --- /dev/null +++ b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/ResourceStateColumns.kt @@ -0,0 +1,101 @@ +/* + * 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("ResourceStateColumns") +package org.opendc.trace.conv + +import org.opendc.trace.TableColumn +import org.opendc.trace.column +import java.time.Duration +import java.time.Instant + +/** + * The timestamp at which the state was recorded. + */ +@JvmField +public val RESOURCE_STATE_TIMESTAMP: TableColumn = column("resource_state:timestamp") + +/** + * Duration for the state. + */ +@JvmField +public val RESOURCE_STATE_DURATION: TableColumn = column("resource_state:duration") + +/** + * A flag to indicate that the resource is powered on. + */ +@JvmField +public val RESOURCE_STATE_POWERED_ON: TableColumn = column("resource_state:powered_on") + +/** + * Total CPU usage of the resource in MHz. + */ +@JvmField +public val RESOURCE_STATE_CPU_USAGE: TableColumn = column("resource_state:cpu_usage") + +/** + * Total CPU usage of the resource in percentage. + */ +@JvmField +public val RESOURCE_STATE_CPU_USAGE_PCT: TableColumn = column("resource_state:cpu_usage_pct") + +/** + * Total CPU demand of the resource in MHz. + */ +@JvmField +public val RESOURCE_STATE_CPU_DEMAND: TableColumn = column("resource_state:cpu_demand") + +/** + * CPU ready percentage. + */ +@JvmField +public val RESOURCE_STATE_CPU_READY_PCT: TableColumn = column("resource_state:cpu_ready_pct") + +/** + * Memory usage of the resource in KB. + */ +@JvmField +public val RESOURCE_STATE_MEM_USAGE: TableColumn = column("resource_state:mem_usage") + +/** + * Disk read throughput of the resource in KB/s. + */ +@JvmField +public val RESOURCE_STATE_DISK_READ: TableColumn = column("resource_state:disk_read") + +/** + * Disk write throughput of the resource in KB/s. + */ +@JvmField +public val RESOURCE_STATE_DISK_WRITE: TableColumn = column("resource_state:disk_write") + +/** + * Network receive throughput of the resource in KB/s. + */ +@JvmField +public val RESOURCE_STATE_NET_RX: TableColumn = column("resource_state:net_rx") + +/** + * Network transmit throughput of the resource in KB/s. + */ +@JvmField +public val RESOURCE_STATE_NET_TX: TableColumn = column("resource_state:net_tx") diff --git a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/TableColumns.kt b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/TableColumns.kt new file mode 100644 index 00000000..31a58360 --- /dev/null +++ b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/TableColumns.kt @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 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("TableColumns") +package org.opendc.trace + +/** + * Construct a [TableColumn] with the specified [name] and type [T]. + */ +public inline fun column(name: String): TableColumn = column(name, T::class.java) + +/** + * Construct a [TableColumn] with the specified [name] and [type]. + */ +public fun column(name: String, type: Class): TableColumn = TableColumn(name, type) 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 new file mode 100644 index 00000000..669ebe58 --- /dev/null +++ b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/Tables.kt @@ -0,0 +1,49 @@ +/* + * 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("Tables") +package org.opendc.trace.conv + +/** + * A table containing all workflows in a workload. + */ +public const val TABLE_WORKFLOWS: String = "workflows" + +/** + * A table containing all tasks in a workload. + */ +public const val TABLE_TASKS: String = "tasks" + +/** + * A table containing all resources in a workload. + */ +public const val TABLE_RESOURCES: String = "resources" + +/** + * A table containing all resource states in a workload. + */ +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" diff --git a/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/TaskColumns.kt b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/TaskColumns.kt new file mode 100644 index 00000000..397c0794 --- /dev/null +++ b/opendc-trace/opendc-trace-api/src/main/kotlin/org/opendc/trace/conv/TaskColumns.kt @@ -0,0 +1,101 @@ +/* + * 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("TaskColumns") +package org.opendc.trace.conv + +import org.opendc.trace.TableColumn +import org.opendc.trace.column +import java.time.Duration +import java.time.Instant + +/** + * A column containing the task identifier. + */ +@JvmField +public val TASK_ID: TableColumn = column("task:id") + +/** + * A column containing the identifier of the workflow. + */ +@JvmField +public val TASK_WORKFLOW_ID: TableColumn = column("task:workflow_id") + +/** + * A column containing the submission time of the task. + */ +@JvmField +public val TASK_SUBMIT_TIME: TableColumn = column("task:submit_time") + +/** + * A column containing the wait time of the task. + */ +@JvmField +public val TASK_WAIT_TIME: TableColumn = column("task:wait_time") + +/** + * A column containing the runtime time of the task. + */ +@JvmField +public val TASK_RUNTIME: TableColumn = column("task:runtime") + +/** + * A column containing the parents of a task. + */ +@JvmField +public val TASK_PARENTS: TableColumn> = column("task:parents") + +/** + * A column containing the children of a task. + */ +@JvmField +public val TASK_CHILDREN: TableColumn> = column("task:children") + +/** + * A column containing the requested CPUs of a task. + */ +@JvmField +public val TASK_REQ_NCPUS: TableColumn = column("task:req_ncpus") + +/** + * A column containing the allocated CPUs of a task. + */ +@JvmField +public val TASK_ALLOC_NCPUS: TableColumn = column("task:alloc_ncpus") + +/** + * A column containing the status of a task. + */ +@JvmField +public val TASK_STATUS: TableColumn = column("task:status") + +/** + * A column containing the group id of a task. + */ +@JvmField +public val TASK_GROUP_ID: TableColumn = column("task:group_id") + +/** + * A column containing the user id of a task. + */ +@JvmField +public val TASK_USER_ID: TableColumn = column("task:user_id") -- cgit v1.2.3