diff options
| author | mjkwiatkowski <mati.rewa@gmail.com> | 2026-02-23 12:05:58 +0100 |
|---|---|---|
| committer | mjkwiatkowski <mati.rewa@gmail.com> | 2026-02-23 12:05:58 +0100 |
| commit | 4f816318b6672d40f23b22ca44cc06b77cadf961 (patch) | |
| tree | 40aa2cae25fee7a92eb36d1d471534a8b53fecd0 /opendc-compute/opendc-compute-simulator | |
| parent | daad473975cc3e6eba0536d5a8fe750cf8b2fa7d (diff) | |
Diffstat (limited to 'opendc-compute/opendc-compute-simulator')
2 files changed, 14 insertions, 3 deletions
diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/scheduler/SmartScheduler.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/scheduler/SmartScheduler.kt index a4c4209c..baadd806 100644 --- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/scheduler/SmartScheduler.kt +++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/scheduler/SmartScheduler.kt @@ -22,10 +22,21 @@ package org.opendc.compute.simulator.scheduler +import org.opendc.common.utils.HTTPClient import org.opendc.compute.simulator.service.HostView import org.opendc.compute.simulator.service.ServiceTask -public class SmartScheduler() : ComputeScheduler { +public class SmartScheduler : ComputeScheduler { + private val client = HTTPClient.getInstance() + // the point is that a smart scheduler listens for suggestions from the + // digital twin + // and here is where you change your actions based on the result from the DT + // predictive analytics is going to be much easier to do. + // you will completely overcome the overhead of having to tap-into + // the digital twin mid-through the simulation/in between two hosts being scheduled + // i.e., the normal simulation will NOT have to wait. + // predictive analytics will overcome the problem of the scheduling time overhead + override fun addHost(host: HostView) { TODO("Not yet implemented") } diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/KafkaComputeMonitor.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/KafkaComputeMonitor.kt index 5dfa21c5..c8368af2 100644 --- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/KafkaComputeMonitor.kt +++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/KafkaComputeMonitor.kt @@ -25,9 +25,8 @@ package org.opendc.compute.simulator.telemetry import org.opendc.common.ProtobufMetrics import org.opendc.common.utils.Kafka import org.opendc.compute.simulator.telemetry.table.host.HostTableReader - /** - * This class logs data from the simulator into Kafka. + * This class logs data from the simulator into a Kafka topic. * The data uses the Protobuf format. * * @author Mateusz Kwiatkowski @@ -50,6 +49,7 @@ public class KafkaComputeMonitor : ComputeMonitor { .setEnergyusage(reader.energyUsage) .build() this.send(packet) + } catch (e: Exception) { println("${e.message}") } |
