Loader.LoadProfile (loader v0.3.0)
A struct representing a distribution of discrete work tasks over a period of time, and functions for working with that data.
See Loader.LoadProfile.Curves
for details on defining the function
of a LoadProfile
, which determines the distribution of work tasks.
A LoadProfile
is defined independently from the type of work being done. It could describe calls made against a remote service as easily as work done in a local module.
Link to this section Summary
Functions
Returns a new LoadProfile
based on the given props, with incorrect props set to default values.
Returns a 2-tuple: a plot of points that represents how tasks would be distributed for the given profile, and the total number of tasks "under the curve" (an approximate integral of the function, reflecting the total number of tasks that will be executed).
Link to this section Types
Link to this section Functions
new(props \\ %{})
Returns a new LoadProfile
based on the given props, with incorrect props set to default values.
rules-for-props
Rules for props:
target_running_time
: must be a positive integerfunction
: must be a 1-arity function. It should also return a number, but this isn't enforced
plot_curve(profile)
Returns a 2-tuple: a plot of points that represents how tasks would be distributed for the given profile, and the total number of tasks "under the curve" (an approximate integral of the function, reflecting the total number of tasks that will be executed).