In JMeter's Gaussian Random Timer, is the Deviation field a cap on the extra pause?
answer
- Compare it with the uniform timer's field
- The name is statistical, not a limit
- Nothing in the element caps the draw
- Watch what the absolute value does
basics
~20 sNo. Deviation is a standard deviation in milliseconds. JMeter scales a Gaussian draw of mean 0 and deviation 1 by that field, adds Constant Delay Offset and takes the absolute value, so individual pauses can exceed the Deviation figure.
solid answer
~40 s`GaussianRandomTimer.delay()` returns `(long) Math.abs(getRandom().nextGaussian() * getRange() + super.delay())`, where `getRange()` is the **Deviation** field and `super.delay()` is **Constant Delay Offset**. The manual describes it the same way: the total is a Gaussian value with mean 0.0 and standard deviation 1.0, times the deviation you specify, plus the offset. Because the Gaussian draw is unbounded, a pause of two or three times the Deviation above the offset is uncommon but perfectly legal, and there is no ceiling field to stop it. The `Math.abs` matters here: if the Deviation is large relative to the offset the sum can go negative, and JMeter folds it back to a positive pause rather than clamping it to zero.
go deeper
Know that the Gaussian Random Timer produces a bell-shaped spread of pauses around the Constant Delay Offset, and that the Deviation field controls how wide that spread is.
Explain the arithmetic: a standard normal draw scaled by Deviation, added to the offset, absolute value taken. Say plainly that the field is a standard deviation and imposes no ceiling.
Point out the folding effect when Deviation is large relative to the offset, and pick the Uniform Random Timer instead when the plan needs a bounded pause you can reason about.
Decide which random timer the team's plans standardise on and write it down, so pause profiles stay comparable between plans and nobody has to reverse-engineer a distribution from field values.
## What the field actually multiplies The Gaussian Random Timer stores the same two properties as its uniform sibling — `ConstantTimer.delay` for **Constant Delay Offset** and `RandomTimer.range` for **Deviation** — and differs only in the draw: ```java // GaussianRandomTimer.delay() return (long) Math.abs((getRandom().nextGaussian() * getRange()) + super.delay()); ``` `nextGaussian()` produces a bell-shaped value centred on 0 with standard deviation 1. Multiplying by the Deviation field stretches that bell; adding the offset shifts it. So Deviation 200 with Constant Delay Offset 1000 gives pauses centred near 1000 ms, with roughly two draws in three inside 800–1200 ms — and a small share outside that window in either direction. It is a *spread* control, not a limit. ## Compared with the other two random timers | Timer | Random field | Shape of the draw | Is the field a bound? | |---|---|---|---| | Uniform Random Timer | Random Delay Maximum | flat over 0 to the field | yes, it is a hard ceiling on the random part | | Gaussian Random Timer | Deviation | bell centred on the offset | no, it is a standard deviation | | Poisson Random Timer | Lambda | Poisson-shaped, mean Lambda | no, it is the mean of the draw | The Poisson timer is the closest cousin in intent: `PoissonRandomTimer.delay()` is `Math.abs(randomPoisson((int) Math.round(getRange())) + super.delay())`, so **Lambda** is rounded to a whole number of milliseconds and used as the mean of the Poisson component, which is then added to the offset. Note that Lambda is rounded — a Lambda of 0.4 rounds to 0 and the timer degenerates to the Constant Delay Offset. ## The absolute value is not cosmetic For the uniform timer, `Math.abs` can never change anything: a non-negative offset plus a non-negative draw is non-negative. For the Gaussian timer it can. Set Deviation 500 and Constant Delay Offset 100 and a draw of −1.5 gives −650 ms, which JMeter turns into a 650 ms pause. The consequence is that with a small offset relative to the Deviation you no longer get a bell centred on the offset — you get a folded distribution whose mass piles up near zero and whose mean is higher than the offset. If you want the shape to behave as the field names suggest, keep the Constant Delay Offset comfortably larger than the Deviation. ## Practical checks - **Read the units.** Both fields are milliseconds, and both are saved as plain strings: the GUI writes the field text straight into `RandomTimer.range`, so a typed `100` is stored as `100`. The `100.0` you often see in a `.jmx` is the GUI's own default value for that field, left untouched. - **There is no maximum field.** If you need a hard ceiling on the pause, the Uniform Random Timer is the element that has one; the Gaussian timer cannot express it. - **Non-numeric values collapse to zero.** Both fields go through JMeter's string-to-number conversion, which returns `0` when parsing fails instead of raising an error, so a typo or an unresolved reference degrades the timer silently rather than failing the plan. - **`timer.factor` scales it.** The Gaussian, Uniform and Poisson timers all implement `ModifiableTimer`, so if the `timer.factor` property is set to anything other than `1.0f` the computed delay is multiplied by it before the thread sleeps. - **The draw is per thread.** `RandomTimer.getRandom()` returns `ThreadLocalRandom.current()`, so each thread has its own generator and threads do not serialise on a shared one. ## How this is usually probed Interviewers rarely ask the formula outright. They ask why a run configured with Deviation 100 and offset 100 produced pauses of 400 ms, or why the observed average pause is higher than the Constant Delay Offset. Both answers come from the same two facts: the Gaussian tail is unbounded, and the absolute value folds the negative side of the bell back onto the positive side.
- What does the Poisson Random Timer's Lambda field set, and how is it stored?Lambda is the mean of the Poisson-distributed component, in milliseconds, added to the timer's own Constant Delay Offset. JMeter rounds it to an integer before drawing, so a Lambda below 0.5 rounds to zero and the timer produces only the offset. Like the other random timers it is saved as RandomTimer.range.
- Which JMeter timer would you use when the pause needs a guaranteed upper bound?The Uniform Random Timer. Its Random Delay Maximum is a hard ceiling on the random component, so the total can never exceed offset plus maximum. Neither the Gaussian nor the Poisson timer exposes a ceiling field, because both draw from unbounded distributions.
Deviation is a scatter dial, not a fence. Turning it up widens the spread of pauses around the offset in both directions; it does not set the furthest a pause can travel from it.
saying these in an interview costs you the question
- Calls Deviation the maximum extra pause the timer can add.
- Says pauses are uniformly spread across the deviation window.
- Claims the Gaussian timer clamps negative totals to zero.
- Thinks Deviation and Random Delay Maximum are interchangeable fields.
- Assumes Poisson Lambda accepts a fractional millisecond value.