@groovy.transform.CompileStatic @org.springframework.boot.context.properties.ConfigurationProperties(prefix: grails.testing.latency) class LatencyProperties extends java.lang.Object
Configuration for artificial request latency, bound from the grails.testing.latency prefix.
Example configuration (application.yml of the application under test, or system properties
passed to the test JVM):
grails:
testing:
latency:
enabled: true
min-delay: 250ms
max-delay: 2s
probability: 0.5
Durations without a unit suffix are interpreted as milliseconds. | Type | Name and description |
|---|---|
boolean |
enabledWhether to inject artificial latency. |
java.time.Duration |
maxDelayUpper bound (inclusive) of the random delay applied to a request. |
java.time.Duration |
minDelayLower bound (inclusive) of the random delay applied to a request. |
double |
probabilityFraction of requests to delay, between 0.0 (none) and 1.0 (all, the default). |
java.lang.Long |
seedOptional fixed seed for the random number generator, for reproducible delay sequences. |
java.util.List<java.lang.String> |
urlPatternsServlet url patterns the latency filter is mapped to. |
| Constructor and description |
|---|
LatencyProperties() |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Whether to inject artificial latency. Disabled by default so the library is inert unless explicitly switched on for a test run.
Upper bound (inclusive) of the random delay applied to a request.
Lower bound (inclusive) of the random delay applied to a request.
Fraction of requests to delay, between 0.0 (none) and 1.0 (all, the default).
Optional fixed seed for the random number generator, for reproducible delay sequences. When unset, delays vary from run to run.
The generator is shared by all requests, so with concurrent requests which request receives which delay is order-dependent; a fixed seed only yields a fully reproducible assignment of delays to requests when requests are serialized.
Servlet url patterns the latency filter is mapped to. Defaults to every request.