packages feed

tkyprof 0.2.0 → 0.2.1

raw patch · 2 files changed

+12/−8 lines, 2 files

Files

ProfilingReport.hs view
@@ -7,7 +7,7 @@     -- * Parsers for sub-parts of the report   , timestamp   , title-  , commandLine +  , commandLine   , totalTime   , totalAlloc   , hotCostCentres@@ -30,7 +30,7 @@ import Data.Conduit.Attoparsec (sinkParser) import Data.ByteString (ByteString) import Data.Conduit-import Data.Foldable (foldl')+import Data.Foldable (asum, foldl') import Data.Time (UTCTime(..), TimeOfDay(..), timeOfDayToTime, fromGregorian) import Data.Tree (Tree(..), Forest) import Data.Tree.Zipper (TreePos, Full)@@ -129,15 +129,19 @@   string "total time  ="; spaces   secs <- double   string " secs"; spaces-  (ticks, res, procs) <- parens $-    (,,) <$> decimal <* string " ticks @ "-         <*> time-         <*> ( string ", " *> decimal <* string " processor" <|> pure 1 )+  (ticks, res, procs) <- parens $ (,,)+    <$> decimal <* string " ticks @ "+    <*> time <* string ", "+    <*> decimal <* many1 (notChar ')')   return TotalTime { totalSecs  = secs                    , totalTicks = ticks                    , resolution = res                    , processors = procs }-  where time = (decimal <* string " us") <|> (pure (*1000) <*> decimal <* string " ms")+  where+    time = asum+      [ decimal <* string " us"+      , pure (*1000) <*> decimal <* string " ms"+      ]  totalAlloc :: Parser TotalAlloc totalAlloc = do
tkyprof.cabal view
@@ -1,5 +1,5 @@ name:                 tkyprof-version:              0.2.0+version:              0.2.1 license:              BSD3 license-file:         LICENSE author:               Mitsutoshi Aoe