Package org.mockserver.load
Enum Class RampCurve
- All Implemented Interfaces:
Serializable,Comparable<RampCurve>,Constable
The interpolation curve used to ramp a value (virtual users or arrival rate) from a
start setpoint to an end setpoint across a LoadStage as its
progress p advances over [0, 1].
valueAt(double, double, double) is the single, pure, tested source of truth for
the curve math so both the closed-model VU driver and the open-model arrival-rate scheduler
interpolate identically. At the endpoints every curve is exact: valueAt(start,end,0)==start
and valueAt(start,end,1)==end.
LINEAR—start + (end-start)*p(constant slope).QUADRATIC—start + (end-start)*p*p(ease-in: slow then fast).EXPONENTIAL—start + (end-start) * (exp(K*p)-1)/(exp(K)-1)withK=4(a steeper ease-in; this normalised form is exact at the endpoints and handlesstart=0correctly).
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptiondoublevalueAt(double start, double end, double p) Interpolate betweenstartandendat progresspusing this curve.static RampCurveReturns the enum constant of this class with the specified name.static RampCurve[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LINEAR
-
QUADRATIC
-
EXPONENTIAL
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
valueAt
public double valueAt(double start, double end, double p) Interpolate betweenstartandendat progresspusing this curve.pis clamped to[0, 1]so an over-run stage stays pinned atend.
-