diff options
| author | Dante Niewenhuis <d.niewenhuis@hotmail.com> | 2024-05-31 16:10:51 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-31 16:10:51 +0200 |
| commit | 23caa622972708bcf626f7747e509022f70d31fc (patch) | |
| tree | cc83d5bc75cb73341dbb2357a57983bd42f6b46d /opendc-compute/opendc-compute-topology/src | |
| parent | ad20465a5df47b49561bb0afbdda5cd65c5da4b8 (diff) | |
Addded host_name and boot_time_absolute to the output files (#233)
Added host_name to the host output file.
Added boot_time_absolute to the server output file.
renamed absolute_timestamp to timestamp_absolute in all output files
Diffstat (limited to 'opendc-compute/opendc-compute-topology/src')
2 files changed, 9 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 bab886a4..656085e8 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 @@ -131,10 +131,17 @@ private fun HostJSONSpec.toHostSpecs( val powerModel = getPowerModel(powerModel.modelType, powerModel.power, powerModel.maxPower, powerModel.idlePower) + var hostName: String + if (name == null) { + hostName = "Host-$hostId" + } else { + hostName = name + } + val hostSpec = HostSpec( UUID(random.nextLong(), (hostId).toLong()), - "$name-${(hostId)}", + hostName, mapOf("cluster" to clusterId), machineModel, SimPsuFactories.simple(powerModel), 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 f34bc855..110d6fb1 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 @@ -61,7 +61,7 @@ public data class ClusterSpec( */ @Serializable public data class HostJSONSpec( - val name: String = "Host", + val name: String? = null, val cpu: CPUSpec, val memory: MemorySpec, val powerModel: PowerModelSpec = PowerModelSpec("linear", 350.0, 400.0, 200.0), |
