Safe Haskell | None |
---|
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 = BoundedMean {}
- 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 {}
- newtype SubGroupName = SubGroupName {}
- data GraphData = GraphData {
- groupLabels :: [GroupName]
- subGroupLabels :: [SubGroupName]
- graphData :: GroupName -> SubGroupName -> BoundedMean
- type GraphDataMapping = String -> Map String (Map String BoundedMean) -> GraphData
- data GraphType
- data Mode
- = JustRun
- | RunAndGraph
- | JustGraph
- data Config = Config {}
- 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.
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.
RunSettings | |
|
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).
GraphSettings | |
|
The name of a particular group on the x-axis; depending on your choice, this could be a benchmark name or a version name.
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).
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.
GraphData | |
|
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
.
The mode; just running and recording a benchmark, just graphing existing results, or running a benchmark and produce a graph (the default).
The mode (RunAndGraph, by default), the run settings and the graph settings.
Config | |
|
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).