From 9c35804edcae26b116da39640a8a2be55ca040a7 Mon Sep 17 00:00:00 2001 From: Harendra Kumar Date: Tue, 10 Apr 2018 16:16:59 +0530 Subject: [PATCH] ignore and continue when graph generation fails --- benchmark/Charts.hs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/benchmark/Charts.hs b/benchmark/Charts.hs index 5b4dda1a..b4d8cbb0 100644 --- a/benchmark/Charts.hs +++ b/benchmark/Charts.hs @@ -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 -- 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-" }