ignore and continue when graph generation fails

This commit is contained in:
Harendra Kumar 2018-04-10 16:16:59 +05:30
parent 7aae14a59f
commit 9c35804edc

View File

@ -1,10 +1,12 @@
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import Data.List
import Data.List.Split
import BenchGraph (bgraph, defaultConfig, Config(..), ComparisonStyle(..))
import Control.Applicative ((<|>))
import Control.Exception (handle, catch, SomeException, ErrorCall)
main :: IO ()
main = do
@ -13,13 +15,15 @@ main = do
, comparisonStyle = CompareDelta
}
ignoringErr a = catch a (\(_ :: ErrorCall) ->
putStrLn "Failed. Skipping.")
-- bgraph <input> <output> <field in csv file to be plotted>
-- other interesting fields to plot are:
-- allocated
-- bytesCopied
-- mutatorCpuSeconds
-- gcCpuSeconds
bgraph "charts/results.csv" "operations" "time" $ cfg
ignoringErr $ bgraph "charts/results.csv" "operations" "time" $ cfg
{ chartTitle = Just "Streamly operations (time)"
, classifyBenchmark = \b ->
if "compose" `isPrefixOf` b || "/concat" `isSuffixOf` b
@ -27,12 +31,13 @@ main = do
else Just ("Streamly", last $ splitOn "/" b)
}
bgraph "charts/results.csv" "composition" "time" $ cfg
ignoringErr $ bgraph "charts/results.csv" "composition" "time" $ cfg
{ chartTitle = Just "Streamly composition performance (time)"
, classifyBenchmark = fmap ("Streamly",) . stripPrefix "compose/"
}
bgraph "charts/results.csv" "composition-scaling" "time" $ cfg
ignoringErr $ bgraph "charts/results.csv" "composition-scaling" "time"
$ cfg
{ chartTitle = Just "Streamly composition scaling (time)"
, classifyBenchmark = fmap ("Streamly",) . stripPrefix "compose-"
}