summaryrefslogtreecommitdiff
path: root/simulator/opendc-compute
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-03-30 22:42:41 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-04-08 14:29:32 +0200
commit638dd7a33d5f7f0b8fcca9c99cdc92819cf0847c (patch)
tree739a8569545608068141288eb25ae80ce2597b7d /simulator/opendc-compute
parent6a04ae25ca18f959b8f2b768c8ce2c285ed72c09 (diff)
exp: Add experiment for OpenDC Energy project
This change adds an experiment for the OpenDC Energy project, which tests various energy models that have been implemented in OpenDC.
Diffstat (limited to 'simulator/opendc-compute')
-rw-r--r--simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt21
1 files changed, 19 insertions, 2 deletions
diff --git a/simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt b/simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt
index 7a0f8bc7..ea775efc 100644
--- a/simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt
+++ b/simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt
@@ -32,6 +32,8 @@ import org.opendc.compute.api.ServerState
import org.opendc.compute.service.driver.*
import org.opendc.simulator.compute.*
import org.opendc.simulator.compute.cpufreq.PerformanceScalingGovernor
+import org.opendc.simulator.compute.cpufreq.ScalingDriver
+import org.opendc.simulator.compute.cpufreq.ScalingGovernor
import org.opendc.simulator.compute.cpufreq.SimpleScalingDriver
import org.opendc.simulator.compute.interference.IMAGE_PERF_INTERFERENCE_MODEL
import org.opendc.simulator.compute.interference.PerformanceInterferenceModel
@@ -56,9 +58,24 @@ public class SimHost(
clock: Clock,
meter: Meter,
hypervisor: SimHypervisorProvider,
- powerModel: PowerModel = ConstantPowerModel(0.0),
+ scalingGovernor: ScalingGovernor,
+ scalingDriver: ScalingDriver,
private val mapper: SimWorkloadMapper = SimMetaWorkloadMapper(),
) : Host, FailureDomain, AutoCloseable {
+
+ public constructor(
+ uid: UUID,
+ name: String,
+ model: SimMachineModel,
+ meta: Map<String, Any>,
+ context: CoroutineContext,
+ clock: Clock,
+ meter: Meter,
+ hypervisor: SimHypervisorProvider,
+ powerModel: PowerModel = ConstantPowerModel(0.0),
+ mapper: SimWorkloadMapper = SimMetaWorkloadMapper(),
+ ) : this(uid, name, model, meta, context, clock, meter, hypervisor, PerformanceScalingGovernor(), SimpleScalingDriver(powerModel), mapper)
+
/**
* The [CoroutineScope] of the host bounded by the lifecycle of the host.
*/
@@ -82,7 +99,7 @@ public class SimHost(
/**
* The machine to run on.
*/
- public val machine: SimBareMetalMachine = SimBareMetalMachine(context, clock, model, PerformanceScalingGovernor(), SimpleScalingDriver(powerModel))
+ public val machine: SimBareMetalMachine = SimBareMetalMachine(context, clock, model, scalingGovernor, scalingDriver)
/**
* The hypervisor to run multiple workloads.