criterion- Robust, reliable performance measurement and analysis

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



Input and output actions.



header :: ByteString #

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

headerRoot :: String #

The magic string we expect to start off the header.

critVersion :: String #

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

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

Read all records from the given Handle.

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

Write records to the given Handle.

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

Read all records from the given file.

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

Write records to the given file.

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

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) #

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 () #

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.