diff options
Diffstat (limited to 'opendc-compute/opendc-compute-topology')
3 files changed, 6 insertions, 2 deletions
diff --git a/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/TopologyFactories.kt b/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/TopologyFactories.kt index 76c653bf..f271c028 100644 --- a/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/TopologyFactories.kt +++ b/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/TopologyFactories.kt @@ -107,6 +107,7 @@ private fun ClusterJSONSpec.toClusterSpec(random: RandomGenerator): ClusterSpec PowerSourceSpec( UUID(random.nextLong(), (clusterId).toLong()), totalPower = this.powerSource.totalPower, + carbonTracePath = this.powerSource.carbonTracePath, ) clusterId++ return ClusterSpec(this.name, hostSpecs, powerSourceSpec) diff --git a/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/specs/PowerSourceSpec.kt b/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/specs/PowerSourceSpec.kt index 79770684..179e8f9e 100644 --- a/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/specs/PowerSourceSpec.kt +++ b/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/specs/PowerSourceSpec.kt @@ -29,5 +29,6 @@ public data class PowerSourceSpec( val uid: UUID, val name: String = "unknown", val meta: Map<String, Any> = emptyMap(), - val totalPower: Long, + val totalPower: Long = Long.MAX_VALUE, + val carbonTracePath: String? = null, ) diff --git a/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/specs/TopologySpecs.kt b/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/specs/TopologySpecs.kt index 9acdf72a..cdc1d96a 100644 --- a/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/specs/TopologySpecs.kt +++ b/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/specs/TopologySpecs.kt @@ -115,6 +115,7 @@ public data class PowerModelSpec( val power: Power = Power.ofWatts(400), val maxPower: Power, val idlePower: Power, + val carbonTracePaths: String? = null, ) { init { require(maxPower >= idlePower) { "The max power of a power model can not be less than the idle power" } @@ -144,7 +145,8 @@ public data class PowerSourceJSONSpec( val vendor: String = "unknown", val modelName: String = "unknown", val arch: String = "unknown", - val totalPower: Long, + val totalPower: Long = Long.MAX_VALUE, + val carbonTracePath: String? = null, ) { public companion object { public val DFLT: PowerSourceJSONSpec = |
