hsbencher-1.20.0.5: Launch and gather data from Haskell and non-Haskell benchmarks.

Safe HaskellNone
LanguageHaskell2010

HSBencher.Internal.Utils

Description

Misc Small Helpers

Synopsis

Documentation

backupResults :: String -> String -> IO () Source

Create a backup copy of existing results_HOST.dat files.

runLogged :: String -> String -> [(String, String)] -> BenchM (RunResult, [ByteString]) Source

Run a command and wait for all output. Log output to the appropriate places. The first argument is a "tag" to append to each output line to make things clearer.

runSL :: String -> IO String Source

Runs a command through the OS shell and returns the first line of output. (Ignore exit code and stderr.)

If the command does not return any output, this function returns the empty string.

runLines :: String -> IO [String] Source

Runs a command through the OS shell and returns stdout split into lines. (Ignore exit code and stderr.)

fetchBaseName :: FilePath -> FilePath Source

A more persistent version of takeBaseName.

echoStream :: Bool -> InputStream ByteString -> BenchM (Async ()) Source

Create a thread that echos the contents of stdout/stderr InputStreams (lines) to the appropriate places (as designated by the logging facility). Returns an MVar used to synchronize on the completion of the echo thread.

main_threadid :: IORef ThreadId Source

Global variable holding the main thread id.