Package cambio.simulator.events
Class ChaosMonkeyEvent
java.lang.Object
desmoj.core.simulator.NamedObject
desmoj.core.simulator.ModelComponent
desmoj.core.simulator.Schedulable
desmoj.core.simulator.EventAbstract
desmoj.core.simulator.ExternalEvent
cambio.simulator.entities.NamedExternalEvent
cambio.simulator.events.ExperimentAction
cambio.simulator.events.SelfScheduledExperimentAction
cambio.simulator.events.ChaosMonkeyEvent
- All Implemented Interfaces:
ISelfScheduled
A
ChaosMonkeyEvent
is an ExternalEvent
that gets scheduled at the beginning of the
experiment. It terminates a specified number of MicroserviceInstance
s from a specified
Microservice
in its
eventRoutine
method.-
Field Summary
Fields inherited from class cambio.simulator.events.ExperimentAction
initialArrivalTime
Fields inherited from class desmoj.core.simulator.EventAbstract
numberOfEntities
Fields inherited from class desmoj.core.simulator.Schedulable
_schedule
-
Constructor Summary
ConstructorsConstructorDescriptionChaosMonkeyEvent
(desmoj.core.simulator.Model model, String name, boolean showInTrace) ChaosMonkeyEvent
(desmoj.core.simulator.Model owner, String name, boolean showInTrace, Microservice microservice, int instances) Instantiate aChaosMonkeyEvent
. -
Method Summary
Methods inherited from class cambio.simulator.events.SelfScheduledExperimentAction
doInitialSelfSchedule, setTargetTime
Methods inherited from class cambio.simulator.events.ExperimentAction
getInitialArrivalTime
Methods inherited from class cambio.simulator.entities.NamedExternalEvent
eventRoutine, getPlainName, getQuotedName, getQuotedPlainName, rename
Methods inherited from class desmoj.core.simulator.ExternalEvent
clone, schedule, schedule, schedule, schedule, scheduleAfter, scheduleBefore, schedulePreempt
Methods inherited from class desmoj.core.simulator.EventAbstract
generateTraceForScheduling, getNumberOfEntities, getRealTimeConstraint, getSchedulingPriority, isExternal, setRealTimeConstraint, setSchedulingPriority
Methods inherited from class desmoj.core.simulator.Schedulable
assignReporter, cancel, getCorrespondingReportable, isCurrent, isScheduled, reSchedule, reSchedule, reSchedulePreempt, scheduledNext, setCorrespondingReportable
Methods inherited from class desmoj.core.simulator.ModelComponent
current, currentEntity, currentEntityAll, currentEvent, currentlySendDebugNotes, currentlySendTraceNotes, currentModel, currentSimProcess, debugIsOn, debugOff, debugOn, getModel, isExperimentCompatible, isModelCompatible, presentTime, sendDebugNote, sendMessage, sendTraceNote, sendWarning, skipTraceNote, skipTraceNote, traceIsOn, traceOff, traceOn
Methods inherited from class desmoj.core.simulator.NamedObject
getName
-
Constructor Details
-
ChaosMonkeyEvent
-
ChaosMonkeyEvent
public ChaosMonkeyEvent(desmoj.core.simulator.Model owner, String name, boolean showInTrace, Microservice microservice, int instances) Instantiate aChaosMonkeyEvent
.- Parameters:
owner
- Model: The model that owns this eventname
- String: The name of this eventshowInTrace
- boolean: Declaration if this event should be shown in the tracemicroservice
- int: The target microservice whose instances should be terminatedinstances
- int: The number of instances of the specified microservice you want to shut down, can be greater than the number of currently running instances
-
-
Method Details
-
onRoutineExecution
public void onRoutineExecution() throws co.paralleluniverse.fibers.SuspendExecutionThe eventRoutine of theChaosMonkeyEvent
. Terminates a specified number of instances of a specifiedMicroservice
. Also tries to note the remaining number of instances in the trace.- Specified by:
onRoutineExecution
in classNamedExternalEvent
- Throws:
co.paralleluniverse.fibers.SuspendExecution
-
toString
- Overrides:
toString
in classdesmoj.core.simulator.NamedObject
-
getTargetService
-