progression- Automates the recording and graphing of criterion benchmarks

Safe HaskellNone



A module exposing the configuration for progression.

Each item is either a Maybe type or a list. The values Nothing or the empty list indicate a lack of preference and will be over-ridden by the other setting in an mappend; settings can be joined together using their monoid instances.



data BoundedMean Source

A type that holds the value for a mean with bounds.




meanLB :: Double
mean :: Double
meanUB :: Double

data RunSettings Source

The settings for running benchmarks; which prefixes to run (empty list means no preference, i.e. all -- not none) and where to put the result.




data GraphSettings m Source

The settings for plotting graphs; which labels (besides the one created by the current run, if applicable) to feature in the graph, and where to store the file (plot.png, by default).

newtype GroupName Source

The name of a particular group on the x-axis; depending on your choice, this could be a benchmark name or a version name.




groupName :: String

newtype SubGroupName Source

The name of a particular element of a group (for line graphs this is the name of the line; for bar charts this is a particular recurring bar colour).




subGroupName :: String

data GraphData Source

Some data that is ready to graph. There are the group labels (groups on the x-axis) which will be plotted in the order given in the list, sub-group labels (either bar colours or lines), and a function that gets the data for a given group label and sub-group label.

It is expected that graphData will only ever be called with combinations of the labels in the attached lists, but that it should return a sensible (i.e. non-bottom) value in all these cases.

type GraphDataMapping = String -> Map String (Map String BoundedMean) -> GraphDataSource

A function for mapping raw data (i.e. read from CSV files) into data arranged for plotting.

The first parameter is the name of the version most recently recorded, or (if just graphing is taking place) the name of the first version listed by the user.

The second parameter is a map from version name (e.g. fused-memo) to: a map from benchmark name (e.g. calculate-primes) to the recorded mean.

The return is the arranged GraphData.

The default is a composition of groupBench and normalise.

data GraphType Source

The type of a graph; lines or bars

data Mode Source

The mode; just running and recording a benchmark, just graphing existing results, or running a benchmark and produce a graph (the default).




data Config Source

The mode (RunAndGraph, by default), the run settings and the graph settings.


newtype Definite a Source

The identity functor




definite :: a

groupBench :: GraphDataMappingSource

A function that turns benchmarks into major groups, versions into sub-groups, and brings the name of the latest version to the head of the sub-group list.

groupVersion :: GraphDataMappingSource

A function that turns versions into major groups, benchmarks into sub-groups, and brings the name of the latest version to the head of the group list.

normalise :: String -> Map String (Map String BoundedMean) -> Map String (Map String BoundedMean)Source

A function that normalises the given data (second parameter) by dividing by the time taken by the given version (first parameter). Benchmarks where the divisor is zero or missing have their times left untouched.

This is intended to be applied before groupBench or groupVersion.

processArgs :: Config -> [String] -> IO ConfigSource

Processes the given arguments (got from getArgs, typically) to adjust the given default configuration, returning the resulting configuration. Exits the whole program with an error if there is a problem, or if the user specified -h (in which case it exits after printing the options).