progression-0.3: Automates the recording and graphing of criterion benchmarksSource codeContentsIndex
Progression.Config
Description

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.

Synopsis
data BoundedMean = BoundedMean {
meanLB :: Double
mean :: Double
meanUB :: Double
}
data RunSettings = RunSettings {
runPrefixes :: [String]
runStoreAs :: Maybe String
}
data GraphSettings m = GraphSettings {
graphCompareTo :: m [String]
graphFilename :: m String
graphSize :: m (Int, Int)
graphLogY :: m Bool
graphType :: m GraphType
graphGroup :: m GraphDataMapping
}
newtype GroupName = GroupName {
groupName :: String
}
newtype SubGroupName = SubGroupName {
subGroupName :: String
}
data GraphData = GraphData {
groupLabels :: [GroupName]
subGroupLabels :: [SubGroupName]
graphData :: GroupName -> SubGroupName -> BoundedMean
}
type GraphDataMapping = String -> Map String (Map String BoundedMean) -> GraphData
data GraphType
= GraphTypeLines
| GraphTypeBars
data Mode
= JustRun
| RunAndGraph
| JustGraph
data Config = Config {
cfgMode :: Maybe Mode
cfgRun :: RunSettings
cfgGraph :: GraphSettings Maybe
}
newtype Definite a = Definite {
definite :: a
}
groupBench :: GraphDataMapping
groupVersion :: GraphDataMapping
normalise :: String -> Map String (Map String BoundedMean) -> Map String (Map String BoundedMean)
override :: GraphSettings Definite -> GraphSettings Maybe -> GraphSettings Definite
processArgs :: Config -> [String] -> IO Config
Documentation
data BoundedMean Source
A type that holds the value for a mean with bounds.
Constructors
BoundedMean
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.
Constructors
RunSettings
runPrefixes :: [String]
runStoreAs :: Maybe String
show/hide Instances
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).
Constructors
GraphSettings
graphCompareTo :: m [String]
graphFilename :: m String
graphSize :: m (Int, Int)
graphLogY :: m Bool
graphType :: m GraphType
graphGroup :: m GraphDataMapping
show/hide Instances
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.
Constructors
GroupName
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).
Constructors
SubGroupName
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.

Constructors
GraphData
groupLabels :: [GroupName]
subGroupLabels :: [SubGroupName]
graphData :: GroupName -> SubGroupName -> BoundedMean
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
Constructors
GraphTypeLines
GraphTypeBars
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).
Constructors
JustRun
RunAndGraph
JustGraph
show/hide Instances
data Config Source
The mode (RunAndGraph, by default), the run settings and the graph settings.
Constructors
Config
cfgMode :: Maybe Mode
cfgRun :: RunSettings
cfgGraph :: GraphSettings Maybe
show/hide Instances
newtype Definite a Source
The identity functor
Constructors
Definite
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.

override :: GraphSettings Definite -> GraphSettings Maybe -> GraphSettings DefiniteSource
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).
Produced by Haddock version 2.6.0