Package org.mockserver.mock.action.http
Class ChaosExperimentOrchestrator.ExperimentDefinition
java.lang.Object
org.mockserver.mock.action.http.ChaosExperimentOrchestrator.ExperimentDefinition
- Enclosing class:
- ChaosExperimentOrchestrator
An experiment definition: name, ordered stages, whether to loop, and an
optional deferred start (
startDelayMillis and/or cronSchedule).
When no scheduling fields are set the experiment starts immediately
(back-compatible default).-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal longWhen> 0(andsloCriteriais set), the orchestrator evaluates the SLO over the pre-experiment lookback window[now - baselineWindowMillis, now]before applying stage 0.final StringStandard 5-field cron expression for the start time;null/blank = none.final booleanfinal Stringfinal booleanWhentrueand acronScheduleis set, the experiment re-arms itself for the next cron occurrence after it completes naturally (retaining per-run verdict history), rather than terminating after a single run.final SloCriteriaOptional SLO asserted over the experiment window.final longFixed delay before stage 0 is applied;0= start immediately. -
Constructor Summary
ConstructorsConstructorDescriptionExperimentDefinition(String name, List<ChaosExperimentOrchestrator.Stage> stages, boolean loop) ExperimentDefinition(String name, List<ChaosExperimentOrchestrator.Stage> stages, boolean loop, long startDelayMillis, String cronSchedule) ExperimentDefinition(String name, List<ChaosExperimentOrchestrator.Stage> stages, boolean loop, long startDelayMillis, String cronSchedule, SloCriteria sloCriteria) ExperimentDefinition(String name, List<ChaosExperimentOrchestrator.Stage> stages, boolean loop, long startDelayMillis, String cronSchedule, SloCriteria sloCriteria, boolean recurring, long baselineWindowMillis) -
Method Summary
Modifier and TypeMethodDescriptionfromJson(com.fasterxml.jackson.databind.JsonNode node) Deserializes an experiment definition from a JSON node.com.fasterxml.jackson.databind.node.ObjectNodetoJson()Serializes this experiment definition to a JSON node.booleantruewhen any stage stages one or more TCP chaos profiles.
-
Field Details
-
name
-
stages
-
loop
public final boolean loop -
startDelayMillis
public final long startDelayMillisFixed delay before stage 0 is applied;0= start immediately. -
cronSchedule
Standard 5-field cron expression for the start time;null/blank = none. -
sloCriteria
Optional SLO asserted over the experiment window. Whennullthe experiment behaves exactly as before (no verdict). When present, a terminalexperimentVerdictis produced over the experiment window when the experiment terminates. -
recurring
public final boolean recurringWhentrueand acronScheduleis set, the experiment re-arms itself for the next cron occurrence after it completes naturally (retaining per-run verdict history), rather than terminating after a single run. Defaultfalse= the pre-existing one-shot behaviour. Ignored (rejected at validation) without a cron. -
baselineWindowMillis
public final long baselineWindowMillisWhen> 0(andsloCriteriais set), the orchestrator evaluates the SLO over the pre-experiment lookback window[now - baselineWindowMillis, now]before applying stage 0. If the steady state does not already hold (verdict not PASS) the experiment refuses to start (aborted_baseline_unhealthy). Default0= no baseline pre-check (pre-existing behaviour).
-
-
Constructor Details
-
ExperimentDefinition
public ExperimentDefinition(String name, List<ChaosExperimentOrchestrator.Stage> stages, boolean loop) -
ExperimentDefinition
public ExperimentDefinition(String name, List<ChaosExperimentOrchestrator.Stage> stages, boolean loop, long startDelayMillis, String cronSchedule) -
ExperimentDefinition
public ExperimentDefinition(String name, List<ChaosExperimentOrchestrator.Stage> stages, boolean loop, long startDelayMillis, String cronSchedule, SloCriteria sloCriteria) -
ExperimentDefinition
public ExperimentDefinition(String name, List<ChaosExperimentOrchestrator.Stage> stages, boolean loop, long startDelayMillis, String cronSchedule, SloCriteria sloCriteria, boolean recurring, long baselineWindowMillis)
-
-
Method Details
-
usesTcpProfiles
public boolean usesTcpProfiles()truewhen any stage stages one or more TCP chaos profiles. -
fromJson
public static ChaosExperimentOrchestrator.ExperimentDefinition fromJson(com.fasterxml.jackson.databind.JsonNode node) Deserializes an experiment definition from a JSON node. -
toJson
public com.fasterxml.jackson.databind.node.ObjectNode toJson()Serializes this experiment definition to a JSON node.
-