Class NetworkDisruption.NetworkDelay
java.lang.Object
org.elasticsearch.test.disruption.NetworkDisruption.NetworkLinkDisruptionType
org.elasticsearch.test.disruption.NetworkDisruption.NetworkDelay
- Enclosing class:
NetworkDisruption
public static class NetworkDisruption.NetworkDelay
extends NetworkDisruption.NetworkLinkDisruptionType
Simulates slow or congested network. Delivery of requests that are sent from source to target node are delayed by a configurable
time amount.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.elasticsearch.core.TimeValuestatic final org.elasticsearch.core.TimeValue -
Constructor Summary
ConstructorsConstructorDescriptionNetworkDelay(org.elasticsearch.core.TimeValue delay) Delays requests by a fixed time value. -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyDisruption(MockTransportService sourceTransportService, MockTransportService targetTransportService) Applies network disruption for requests send from the node represented by the source transport service to the node represented by the target transport service.org.elasticsearch.core.TimeValueReturns expected time to heal after disruption has been removed.Delays requests by a random but fixed time value betweenDEFAULT_DELAY_MINandDEFAULT_DELAY_MAX.random(Random random, org.elasticsearch.core.TimeValue delayMin, org.elasticsearch.core.TimeValue delayMax) Delays requests by a random but fixed time value between delayMin and delayMax.toString()Methods inherited from class org.elasticsearch.test.disruption.NetworkDisruption.NetworkLinkDisruptionType
removeDisruption
-
Field Details
-
DEFAULT_DELAY_MIN
public static final org.elasticsearch.core.TimeValue DEFAULT_DELAY_MIN -
DEFAULT_DELAY_MAX
public static final org.elasticsearch.core.TimeValue DEFAULT_DELAY_MAX
-
-
Constructor Details
-
NetworkDelay
public NetworkDelay(org.elasticsearch.core.TimeValue delay) Delays requests by a fixed time value.- Parameters:
delay- time to delay requests
-
-
Method Details
-
random
Delays requests by a random but fixed time value betweenDEFAULT_DELAY_MINandDEFAULT_DELAY_MAX.- Parameters:
random- instance to use for randomization of delay
-
random
public static NetworkDisruption.NetworkDelay random(Random random, org.elasticsearch.core.TimeValue delayMin, org.elasticsearch.core.TimeValue delayMax) Delays requests by a random but fixed time value between delayMin and delayMax.- Parameters:
random- instance to use for randomization of delaydelayMin- minimum delaydelayMax- maximum delay
-
applyDisruption
public void applyDisruption(MockTransportService sourceTransportService, MockTransportService targetTransportService) Description copied from class:NetworkDisruption.NetworkLinkDisruptionTypeApplies network disruption for requests send from the node represented by the source transport service to the node represented by the target transport service.- Specified by:
applyDisruptionin classNetworkDisruption.NetworkLinkDisruptionType- Parameters:
sourceTransportService- source transport service from which requests are senttargetTransportService- target transport service to which requests are sent
-
expectedTimeToHeal
public org.elasticsearch.core.TimeValue expectedTimeToHeal()Description copied from class:NetworkDisruption.NetworkLinkDisruptionTypeReturns expected time to heal after disruption has been removed. Defaults to instant healing.- Overrides:
expectedTimeToHealin classNetworkDisruption.NetworkLinkDisruptionType
-
toString
-