criterion-1.6.1.0: Robust, reliable performance measurement and analysis

Copyright | (c) 2009-2014 Bryan O'Sullivan
License | BSD-style
Maintainer | bos@serpentine.com
Stability | experimental
Portability | GHC
Safe Haskell | Trustworthy
Language | Haskell2010

Criterion.Report

Contents

- Rendering helper functions

Description

Reporting functions.

Synopsis

- formatReport :: [Report] -> Text -> IO Text
- report :: [Report] -> Criterion ()
- tidyTails :: KDE -> KDE
- data TemplateException = TemplateNotFound FilePath
- loadTemplate :: [FilePath] -> FilePath -> IO Text
- includeFile :: MonadIO m => [FilePath] -> FilePath -> m Text
- getTemplateDir :: IO FilePath
- vector :: (Vector v a, ToJSON a) => Text -> v a -> Value
- vector2 :: (Vector v a, Vector v b, ToJSON a, ToJSON b) => Text -> Text -> v a -> v b -> Value

# Documentation

formatReport Source #

Arguments

:: [Report] |
-> Text | Mustache template.
-> IO Text |

Format a series of `Report` values using the given Mustache template.

report :: [Report] -> Criterion () Source #

Write out a series of `Report` values to a single file, if configured to do so.

tidyTails :: KDE -> KDE Source #

Trim long flat tails from a KDE plot.

# Rendering helper functions

data TemplateException Source #

A problem arose with a template.

Constructors

TemplateNotFound FilePath | The template could not be found.

#### Instances

Instances details

Data TemplateException Source # |

Instance details

Defined in Criterion.Report

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TemplateException -> c TemplateException Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TemplateException Source #

toConstr :: TemplateException -> Constr Source #

dataTypeOf :: TemplateException -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TemplateException) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TemplateException) Source #

gmapT :: (forall b. Data b => b -> b) -> TemplateException -> TemplateException Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TemplateException -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TemplateException -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> TemplateException -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TemplateException -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TemplateException -> m TemplateException Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TemplateException -> m TemplateException Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TemplateException -> m TemplateException Source #

Exception TemplateException Source # |
Instance details Defined in Criterion.Report Methods toException :: TemplateException -> SomeException Source # fromException :: SomeException -> Maybe TemplateException Source # displayException :: TemplateException -> String Source #
Generic TemplateException Source # |
Instance details Defined in Criterion.Report Associated Types type Rep TemplateException :: Type -> Type Source # Methods from :: TemplateException -> Rep TemplateException x Source # to :: Rep TemplateException x -> TemplateException Source #
Read TemplateException Source # |
Instance details Defined in Criterion.Report Methods readsPrec :: Int -> ReadS TemplateException Source # readList :: ReadS [TemplateException] Source # readPrec :: ReadPrec TemplateException Source # readListPrec :: ReadPrec [TemplateException] Source #
Show TemplateException Source # |
Instance details Defined in Criterion.Report Methods showsPrec :: Int -> TemplateException -> ShowS Source # show :: TemplateException -> String Source # showList :: [TemplateException] -> ShowS Source #
Eq TemplateException Source # |
Instance details Defined in Criterion.Report Methods (==) :: TemplateException -> TemplateException -> Bool Source # (/=) :: TemplateException -> TemplateException -> Bool Source #
type Rep TemplateException Source # |
Instance details Defined in Criterion.Report type Rep TemplateException = D1 ('MetaData "TemplateException" "Criterion.Report" "criterion-1.6.1.0-5Dglx1A44dnBE6TqLvZU3n" 'False) (C1 ('MetaCons "TemplateNotFound" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)))

loadTemplate Source #

Arguments

:: [FilePath] | Search path.
-> FilePath | Name of template file.
-> IO Text |

Load a Mustache template file.

If the name is an absolute or relative path, the search path is not used, and the name is treated as a literal path.

If the `-fembed-data-files` `Cabal` flag is enabled, this also checks the embedded `data-files` from `criterion.cabal`.

This function throws a `TemplateException` if the template could not be found, or an `IOException` if no template could be loaded.

includeFile Source #

Arguments

:: MonadIO m |
=> [FilePath] | Directories to search.
-> FilePath | Name of the file to search for.
-> m Text |

Attempt to include the contents of a file based on a search path. Returns `empty` if the search fails or the file could not be read.

Intended for preprocessing Mustache files, e.g. replacing sections

    {{#include}}file.txt{{/include}

with file contents.

getTemplateDir :: IO FilePath Source #

Return the path to the template and other files used for generating reports.

When the `-fembed-data-files` `Cabal` flag is enabled, this simply returns the empty path.

vector Source #

Arguments

:: (Vector v a, ToJSON a) |
=> Text | Name to use when substituting.
-> v a |
-> Value |

Render the elements of a vector.

It will substitute each value in the vector for `x` in the following Mustache template:

    {{#foo}}
     {{x}}
    {{/foo}}

vector2 Source #

Arguments

:: (Vector v a, Vector v b, ToJSON a, ToJSON b) |
=> Text | Name for elements from the first vector.
-> Text | Name for elements from the second vector.
-> v a | First vector.
-> v b | Second vector.
-> Value |

Render the elements of two vectors.