Loader.LoadProfile.Curves (loader v0.3.0)
Convenience functions for defining typical "curves" (i.e. "functions") for the request distribution
in a LoadProfile
.
Some function families, like exponentiation and logarithms, are varied enough or complex enough that i believe they are better expressed as "plain" callback functions, e.g. fn x -> -1 * :math.pow(2, (x + 3)) + 4
.
These function families have thus been excluded from this module.
In the context of a LoadProfile
, the unit for x
is always seconds.
Link to this section Summary
Functions
A sinusoidal function with a modification such that the result is always >= 0. Accepts options to modify the oscillation of the wave.
Link to this section Functions
linear(x, slope, y_intercept)
quadratic(x, quadratic_coefficient, linear_coefficient \\ 1, constant \\ 0)
sine_wave(x, opts \\ [])
A sinusoidal function with a modification such that the result is always >= 0. Accepts options to modify the oscillation of the wave.
options
Options
:amplitude
: a measure of the peak deviation of the wave from it's center. To keep all values of the wave >= 0, the vertical center of the wave will also be equal to its amplitude. Should be a positive number, and will be forced as such viaKernel.abs/1
. Defaults to1
.:frequency
: the number of oscillations (cycles) that occur each second. Defaults to1
.:angular_frequency
: the rate-of-change of the function, in units of radians/second. Mutually exclusive with:frequency
, with:angular_frequency
taking precedence. Defaults tonil
.:phase
: specifies, in radians, where in the wave's cycle the oscillation will begin, when x = 0. Defaults to0
.
See https://en.wikipedia.org/wiki/Sine_wave for more info on sine waves