criterion- Robust, reliable performance measurement and analysis

Copyright(c) 2009-2014 Bryan O'Sullivan
Safe HaskellTrustworthy



Input and output actions.



header :: ByteString Source #

The header identifies a criterion data file. This contains version information; there is no expectation of cross-version compatibility.

headerRoot :: String Source #

The magic string we expect to start off the header.

critVersion :: String Source #

The current version of criterion, encoded into a string that is used in files.

hGetRecords :: Binary a => Handle -> IO (Either String [a]) Source #

Read all records from the given Handle.

hPutRecords :: Binary a => Handle -> [a] -> IO () Source #

Write records to the given Handle.

readRecords :: Binary a => FilePath -> IO (Either String [a]) Source #

Read all records from the given file.

writeRecords :: Binary a => FilePath -> [a] -> IO () Source #

Write records to the given file.

type ReportFileContents = (String, String, [Report]) Source #

On disk we store (name,version,reports), where version is the version of Criterion used to generate the file.

readJSONReports :: FilePath -> IO (Either String ReportFileContents) Source #

Alternative file IO with JSON instances. Read a list of reports from a .json file produced by criterion.

If the version does not match exactly, this issues a warning.

writeJSONReports :: FilePath -> [Report] -> IO () Source #

Write a list of reports to a JSON file. Includes a header, which includes the current Criterion version number. This should be the inverse of readJSONReports.