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
Modifier and TypeFieldDescriptionstatic org.elasticsearch.core.TimeValue
static org.elasticsearch.core.TimeValue
-
Constructor Summary
ConstructorDescriptionNetworkDelay
(org.elasticsearch.core.TimeValue delay) Delays requests by a fixed time value. -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyDisruption
(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.TimeValue
Returns expected time to heal after disruption has been removed.Delays requests by a random but fixed time value betweenDEFAULT_DELAY_MIN
andDEFAULT_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 org.elasticsearch.core.TimeValue DEFAULT_DELAY_MIN -
DEFAULT_DELAY_MAX
public static 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_MIN
andDEFAULT_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.NetworkLinkDisruptionType
Applies 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:
applyDisruption
in 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.NetworkLinkDisruptionType
Returns expected time to heal after disruption has been removed. Defaults to instant healing.- Overrides:
expectedTimeToHeal
in classNetworkDisruption.NetworkLinkDisruptionType
-
toString
-