bench-graph 0.1.2 → 0.1.3
raw patch · 4 files changed
+30/−6 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Changelog.md +4/−0
- bench-graph.cabal +1/−1
- lib/BenchGraph.hs +24/−5
- test/Main.hs +1/−0
Changelog.md view
@@ -1,3 +1,7 @@+## 0.1.3++* Add maxrss plotting support+ ## 0.1.2 * Fixed a bug that caused missing graphs in some cases when multiple iterations
bench-graph.cabal view
@@ -1,5 +1,5 @@ name: bench-graph-version: 0.1.2+version: 0.1.3 synopsis: Plot and compare benchmarks description: Plot benchmarks and compare them. An easy to use package to produce pretty
lib/BenchGraph.hs view
@@ -467,16 +467,31 @@ case csvData of Left e -> error $ show e Right csvlines -> do+ -- XXX make the multiplier and units configurable+ -- XXX Use a separate table for the defaults let isTimeField = let x = map toUpper fieldName in x == "TIME" || x == "MEAN"+ let isAllocationField =+ let x = map toUpper fieldName+ in x == "ALLOCATED" || x == "MAXRSS"+ -- By default the fields are considered "scaled" fields that is+ -- they scale by iterations. However in case of maxrss field it is+ -- a max value across the experiment and does not scale by+ -- iterations, in this case we just need to take a mean or max+ -- without scaling.+ let isMaxField =+ let x = map toUpper fieldName+ in x == "MAXRSS" (multiplier, units) = case isTimeField of -- XXX automatically use ns/us/ms/sec on the scale -- get the max and convert it to appropriate unit True -> (1000, "ms")- False -> (1, "")+ False -> case isAllocationField of+ True -> (1/2^(20 :: Int), "MiB")+ False -> (1, "") -- XXX need the ability to specify Units in the scale yindexes =@@ -504,10 +519,12 @@ let iters = map (readWithError "iter" "Double" 0) xs :: [Double] values = map (readWithError "requested" "Double" 1) xs :: [Double] mean = sum values / sum iters- in show $ case isTimeField of- True -> mean * multiplier- False -> mean+ in show $ mean * multiplier + foldToMax xs =+ let values = map (readWithError "requested" "Double" 1) xs :: [Double]+ in show $ (maximum values) * multiplier+ in -- Add line numbers for error reporting zip [1..] csvlines -- cleanup blank rows@@ -532,7 +549,9 @@ -- xs below is a list of tuples [(lineno, [name, iter, field]] -- we send [(lineno, [iter, field])] to foldToMean. & map (\xs -> [ head $ map (head . snd) xs- , foldToMean $ map (\(l, ys) -> (l, tail ys)) xs+ , if isMaxField+ then foldToMax $ map (\(l, ys) -> (l, tail ys)) xs+ else foldToMean $ map (\(l, ys) -> (l, tail ys)) xs ] ) -- XXX send tuples [(String, Double)] instead of [[String]]
test/Main.hs view
@@ -100,3 +100,4 @@ bgraph "test/results.csvraw" "csvraw-gcWallSeconds-full" "gcWallSeconds" cfg bgraph "test/results.csvraw" "csvraw-gcCpuSeconds-full" "gcCpuSeconds" cfg bgraph "test/results.csvraw" "csvraw-cycles-full" "cycles" cfg+ bgraph "test/results.csvraw" "csvraw-maxrss-full" "maxrss" cfg