alchemy v0.3.1 Alchemy.Experiment View Source

Link to this section Summary

Functions

Adds a candidate function to the experiment. The candidate needs to be wrapped in a function in order to be lazily-evaluated. When the experiment is run the candidate will be evaluated and compared to the control.

Adds a clean function. This function will be run for each observation and can be used to reduce noise when publishing results.

Adds a comparator to use when comparing the candidate to the control. By default the comparator is

Adds a control function to the experiment. Controls should be wrapped in a function in order to be lazily-evaluated

Generates a new experiment. Alias for Experiment.new/1

Adds an ignore clause to the experiment. This clause will be called if there is a mismatch between the control values and the candidate values. This is a useful function if you want to ignore known mismatches. Multiple ignore clauses can be stacked together.

Sets the function to use for publishing results. Can accept either a module or a function. If a module name is passed in then the module is expected to have a publish/1 function which will be used for publishing results.

Runs the experiment.

Link to this section Functions

Link to this function

candidate(experiment, thunk) View Source

Adds a candidate function to the experiment. The candidate needs to be wrapped in a function in order to be lazily-evaluated. When the experiment is run the candidate will be evaluated and compared to the control.

Adds a clean function. This function will be run for each observation and can be used to reduce noise when publishing results.

Link to this function

comparator(experiment, thunk) View Source

Adds a comparator to use when comparing the candidate to the control. By default the comparator is:

fn(control, candidate) -> control == candidate end
Link to this function

control(experiment, thunk) View Source

Adds a control function to the experiment. Controls should be wrapped in a function in order to be lazily-evaluated

Generates a new experiment. Alias for Experiment.new/1

Adds an ignore clause to the experiment. This clause will be called if there is a mismatch between the control values and the candidate values. This is a useful function if you want to ignore known mismatches. Multiple ignore clauses can be stacked together.

Link to this function

publisher(experiment, mod) View Source

Sets the function to use for publishing results. Can accept either a module or a function. If a module name is passed in then the module is expected to have a publish/1 function which will be used for publishing results.

Runs the experiment.

If the candidate is provided then it will be run against the control. The control must be provided for the experiment to be run. The control is always returned. The execution order is randomized to account for any ordering issues. Execution for these functions is done in serial. This is because adding concurrent execution adds additional layers of error handling that would need to occur and doing so is best done in the users application code and not in this library code.