summaryrefslogtreecommitdiff
path: root/opendc-compute
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-compute')
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/scheduler/SmartScheduler.kt13
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/telemetry/KafkaComputeMonitor.kt4
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}")
}