Copyright | (c) 2018 Composewell Technologies |
---|---|
License | BSD3 |
Maintainer | harendra.kumar@gmail.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data Presentation
- = Solo
- | Groups GroupStyle
- | Fields
- data GroupStyle
- = Absolute
- | Diff
- | PercentDiff
- | Multiples
- data FieldTick
- data SortColumn
- = ColumnIndex Int
- | ColumnName (Either String (String, Int))
- data RelativeUnit = RelativeUnit String Double
- data Estimator
- = Median
- | Mean
- | Regression
- data DiffStrategy
- data TitleAnnotation
- data Config = Config {
- verbose :: Bool
- outputDir :: Maybe FilePath
- mkTitle :: Maybe (String -> String)
- title :: Maybe String
- titleAnnotations :: [TitleAnnotation]
- presentation :: Presentation
- estimator :: Estimator
- threshold :: Word
- diffStrategy :: DiffStrategy
- omitBaseline :: Bool
- selectFields :: [String] -> [String]
- fieldRanges :: [(String, Double, Double)]
- fieldTicks :: [(String, FieldTick)]
- classifyBenchmark :: String -> Maybe (String, String)
- selectGroups :: [(String, Int)] -> [(String, Int)]
- selectBenchmarks :: (SortColumn -> Maybe GroupStyle -> Either String [(String, Double)]) -> [String]
- defaultConfig :: Config
- getFieldRange :: String -> Config -> Maybe (Double, Double)
- getFieldTick :: String -> Config -> Maybe FieldTick
- data GroupMatrix = GroupMatrix {
- groupIndex :: Int
- groupName :: String
- groupBenches :: [(String, String)]
- groupMatrix :: BenchmarkMatrix
- prepareGroupMatrices :: Config -> FilePath -> CSV -> [String] -> IO (Int, [GroupMatrix])
- data ReportColumn = ReportColumn {
- colName :: String
- colUnit :: RelativeUnit
- colValues :: [Double]
- colAnalyzed :: [AnalyzedField]
- data RawReport = RawReport {}
- data ReportType
- diffString :: Presentation -> DiffStrategy -> Maybe String
- makeTitle :: String -> Maybe String -> Config -> String
- prepareToReport :: FilePath -> Config -> IO (CSV, [String])
- reportComparingGroups :: GroupStyle -> FilePath -> Maybe FilePath -> ReportType -> Int -> Config -> (RawReport -> Config -> IO ()) -> [GroupMatrix] -> String -> IO ()
- reportPerGroup :: FilePath -> Maybe FilePath -> ReportType -> Config -> (RawReport -> Config -> IO ()) -> GroupMatrix -> IO ()
Documentation
data Presentation Source #
How to present the reports or graphs. Each report presents a number of benchmarks as rows, it may have, (1) a single column presenting the values for a single field, (2) multiple columns presenting values for different fields, or (3) multiple columns presenting values of the same field for different groups.
Since: 0.2.0
Solo | Reports are generated for each group and for
each field selected by the configuration. Each
report presents benchmarks in a single group with a
single column presenting a single field. If there
are |
Groups GroupStyle | One report is generated for each field selected by
the configuration. Each report presents a field
with all the groups selected by the configuration as
columns or clusters. Output files are named using
|
Fields | One report is generated for each group selected by
the configuration. Each report presents a group
with all the fields selected by the configuration as
columns or clusters. Output files are named using
|
Instances
Eq Presentation Source # | |
Defined in BenchShow.Internal.Common (==) :: Presentation -> Presentation -> Bool # (/=) :: Presentation -> Presentation -> Bool # | |
Read Presentation Source # | |
Defined in BenchShow.Internal.Common readsPrec :: Int -> ReadS Presentation # readList :: ReadS [Presentation] # | |
Show Presentation Source # | |
Defined in BenchShow.Internal.Common showsPrec :: Int -> Presentation -> ShowS # show :: Presentation -> String # showList :: [Presentation] -> ShowS # |
data GroupStyle Source #
How to show the results for multiple benchmark groups presented in columns or bar chart clusters. In relative comparisons, the first group is considered as the baseline and the subsequent groups are compared against the baseline.
Definition changed in 0.3.0 @since 0.2.0
Absolute | Show absolute values of the field for all groups |
Diff | Show baseline group as absolute values and values for the subsequent groups as difference from the baseline |
PercentDiff | If the value of the group being compared is higher than the baseline then display the difference as percentage of baseline otherwise display the difference as a percentage of the group being compared. |
Multiples | If the value of the group being compared is higher than
the baseline then display |
Instances
Eq GroupStyle Source # | |
Defined in BenchShow.Internal.Common (==) :: GroupStyle -> GroupStyle -> Bool # (/=) :: GroupStyle -> GroupStyle -> Bool # | |
Read GroupStyle Source # | |
Defined in BenchShow.Internal.Common readsPrec :: Int -> ReadS GroupStyle # readList :: ReadS [GroupStyle] # readPrec :: ReadPrec GroupStyle # readListPrec :: ReadPrec [GroupStyle] # | |
Show GroupStyle Source # | |
Defined in BenchShow.Internal.Common showsPrec :: Int -> GroupStyle -> ShowS # show :: GroupStyle -> String # showList :: [GroupStyle] -> ShowS # |
data SortColumn Source #
When sorting and filtering the benchmarks using selectBenchmarks
we can
choose a column as a sort criterion. selectBenchmarks
is provided with
the data for the corresponding column which can be used for sorting the
benchmarks. The column could be a group or a field depending on the
Presentation
.
Since: 0.2.0
ColumnIndex Int | Specify the index of the sort column. Index 0
corresponds to the first |
ColumnName (Either String (String, Int)) | Specify the column using
the name of the group or the field it represents, and the |
data RelativeUnit Source #
Describe a relative unit i.e. a unit in terms of another unit. A relative
unit has a label and a ratio which when multiplied with the unit gives us
the other unit. For example, if the known time unit is seconds, we can
describe a millisecond as Unit "ms" (1/1000)
.
Instances
Show RelativeUnit Source # | |
Defined in BenchShow.Internal.Common showsPrec :: Int -> RelativeUnit -> ShowS # show :: RelativeUnit -> String # showList :: [RelativeUnit] -> ShowS # |
The statistical estimator used to arrive at a single value for a benchmark when samples from multiple experiments are available.
Since: 0.2.0
Median | Report the median, outliers and outlier variance using box-plot method. This is the most robust indicator with respect to outliers when successive runs of benchmarks are compared. |
Mean | Report the mean and the standard deviation from the mean. This is less robust than median but more precise. |
Regression | Report the coefficient of regression, discarding the constant factor, arrived at by linear regression using ordinary least square method. The R-square goodness-of-fit estimate is also reported. It works better when larger number of samples are taken. This cannot be used when the number of samples is less than 2, in that case a mean value is reported instead. |
data DiffStrategy Source #
Strategy to compute the difference between two groups of benchmarks being compared.
Since: 0.2.0
SingleEstimator | Use a single estimator to compute the difference
between the baseline and the candidate. The estimator
that is provided in the |
MinEstimator | Use |
Instances
Read DiffStrategy Source # | |
Defined in BenchShow.Internal.Common readsPrec :: Int -> ReadS DiffStrategy # readList :: ReadS [DiffStrategy] # | |
Show DiffStrategy Source # | |
Defined in BenchShow.Internal.Common showsPrec :: Int -> DiffStrategy -> ShowS # show :: DiffStrategy -> String # showList :: [DiffStrategy] -> ShowS # |
data TitleAnnotation Source #
Deprecated: Please use mkTitle to make a custom title
Additional annotations that can be optionally added to the title of the report or graph.
Since: 0.2.2
Instances
Eq TitleAnnotation Source # | |
Defined in BenchShow.Internal.Common (==) :: TitleAnnotation -> TitleAnnotation -> Bool # (/=) :: TitleAnnotation -> TitleAnnotation -> Bool # | |
Read TitleAnnotation Source # | |
Defined in BenchShow.Internal.Common | |
Show TitleAnnotation Source # | |
Defined in BenchShow.Internal.Common showsPrec :: Int -> TitleAnnotation -> ShowS # show :: TitleAnnotation -> String # showList :: [TitleAnnotation] -> ShowS # |
Configuration governing generation of chart. See defaultConfig
for the
default values of these fields.
Since: 0.2.0
Config | |
|
defaultConfig :: Config Source #
Default configuration. Use this as the base configuration and modify the required fields. The defaults are:
verbose = False mkTitle = Nothing titleAnnotations = [TitleField] outputDir = Nothing presentation = Groups Absolute estimator = Median threshold = 3 diffStrategy = SingleEstimator omitBaseline = False selectFields = filter (flip elem ["time", "mean", "maxrss"] . map toLower) fieldRanges = [] fieldTicks = [] classifyBenchmark = Just . ("default",) selectGroups = id selectBenchmarks = f -> either error (map fst) $ f (ColumnIndex 0) Nothing
Since: 0.2.0
data GroupMatrix Source #
GroupMatrix | |
|
Instances
Show GroupMatrix Source # | |
Defined in BenchShow.Internal.Common showsPrec :: Int -> GroupMatrix -> ShowS # show :: GroupMatrix -> String # showList :: [GroupMatrix] -> ShowS # |
prepareGroupMatrices :: Config -> FilePath -> CSV -> [String] -> IO (Int, [GroupMatrix]) Source #
data ReportColumn Source #
ReportColumn | |
|
Instances
Show ReportColumn Source # | |
Defined in BenchShow.Internal.Common showsPrec :: Int -> ReportColumn -> ShowS # show :: ReportColumn -> String # showList :: [ReportColumn] -> ShowS # |
RawReport | |
|
diffString :: Presentation -> DiffStrategy -> Maybe String Source #
reportComparingGroups :: GroupStyle -> FilePath -> Maybe FilePath -> ReportType -> Int -> Config -> (RawReport -> Config -> IO ()) -> [GroupMatrix] -> String -> IO () Source #
reportPerGroup :: FilePath -> Maybe FilePath -> ReportType -> Config -> (RawReport -> Config -> IO ()) -> GroupMatrix -> IO () Source #