packages feed

eventlog2html 0.9.2 → 0.9.3

raw patch · 5 files changed

+66/−23 lines, 5 filesdep +githashdep ~aesondep ~basedep ~filepathPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependencies added: githash

Dependency ranges changed: aeson, base, filepath, ghc-events, optparse-applicative, semigroups, text

API changes (from Hackage documentation)

+ Eventlog.Args: Run :: Args -> Option
+ Eventlog.Args: ShowVersion :: Option
+ Eventlog.Args: data Option
- Eventlog.Args: args :: IO Args
+ Eventlog.Args: args :: IO Option
- Eventlog.Args: argsInfo :: ParserInfo Args
+ Eventlog.Args: argsInfo :: ParserInfo Option
- Eventlog.Args: defaultArgs :: FilePath -> IO Args
+ Eventlog.Args: defaultArgs :: FilePath -> IO Option
- Eventlog.Types: data ClosureType
+ Eventlog.Types: data () => ClosureType
- Eventlog.Types: data HeapProfBreakdown
+ Eventlog.Types: data () => HeapProfBreakdown

Files

CHANGELOG view
@@ -1,3 +1,9 @@+0.9.3 release 2022-12-11++* Add "--version" flag for eventlog2html which prints the version,+  git commit and git branch used to build eventlog2html.+* Compatability with 9.4.* and 9.2.* compilers.+ 0.9.2 release 2021-11-24  * Improve profile load speed (#150)
eventlog2html.cabal view
@@ -1,6 +1,6 @@ cabal-version:       2.4 Name:                eventlog2html-Version:             0.9.2+Version:             0.9.3 Synopsis:            Visualise an eventlog Description:         eventlog2html is a library for visualising eventlogs.                      At the moment, the intended use is to visualise eventlogs@@ -30,26 +30,26 @@   javascript/generated/vega-lite@4.17.0 extra-doc-files: README.md                  CHANGELOG-Tested-With:         GHC ==8.6.5+Tested-With:         GHC ==9.2.5, GHC ==9.4.3  Library   Build-depends:-    aeson                >= 1.4.3 && < 1.6,-    attoparsec           >= 0.13.2 && < 0.14,+    aeson                >= 1.4.3 && < 1.6 || >= 2.0 && < 2.2,+    attoparsec           >= 0.13.2 && < 0.15,     array                >= 0.5.3 && < 0.6,     base                 >= 4 && < 5,     blaze-html           >= 0.9.1 && < 0.10,-    bytestring           >= 0.10.8 && < 0.11,+    bytestring           >= 0.10.8 && < 0.12,     containers           >= 0.5.0 && < 0.7,     file-embed           >= 0.0.11 && < 0.1,     filepath             >= 1.4.2 && < 1.5,-    ghc-events           >= 0.16.0 && < 0.18,-    hashtables           >= 1.2.3 && < 1.3,-    hvega                >= 0.11.0 && < 0.12,+    ghc-events           >= 0.16.0 && < 0.19,+    hashtables           >= 1.2.3 && < 1.4,+    hvega                >= 0.11.0 && < 0.13,     mtl                  >= 2.2.2 && < 2.3,-    optparse-applicative >= 0.14.3 && < 0.17,-    semigroups           >= 0.18 && < 0.20,-    text                 >= 1.2.3 && < 1.3,+    optparse-applicative >= 0.14.3 && < 0.18,+    semigroups           >= 0.18 && < 0.21,+    text                 >= 1.2.3 && < 1.3 || >= 2.0 && < 2.1,     time                 >= 1.8.0 && < 2.0,     vector               >= 0.11,     trie-simple          >= 0.4,@@ -84,11 +84,14 @@   HS-source-dirs:      main   Main-is:             Main.hs   build-depends:-      base >= 4 && < 5,+      base,       eventlog2html,-      aeson                >= 1.4.3 && < 1.6,-      text                 >= 1.2.3 && < 1.3,-      filepath             >= 1.4.2 && < 1.5+      aeson,+      githash >= 0.1.6.2,+      text,+      filepath+  other-modules:       Paths_eventlog2html+  autogen-modules:     Paths_eventlog2html   Source-repository head
main/Main.hs view
@@ -1,27 +1,49 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE MultiWayIf #-}+{-# LANGUAGE TemplateHaskell #-} module Main (main) where  import Control.Monad import Data.Aeson (encodeFile)+import Data.Version (showVersion) import GHC.IO.Encoding (setLocaleEncoding)+import GitHash (tGitInfoCwdTry, giHash, giBranch) import System.FilePath import System.Exit import System.IO -import Eventlog.Args (args, Args(..))+import Eventlog.Args (args, Args(..), Option(..)) import Eventlog.HtmlTemplate import Eventlog.Data import Eventlog.Types+import Paths_eventlog2html (version)  main :: IO () main = do   -- This fixes a problem for Windows users: https://serokell.io/blog/haskell-with-utf8   setLocaleEncoding utf8   a <- args+  dispatch a+++dispatch :: Option -> IO ()+dispatch ShowVersion = printVersion+dispatch (Run a) = do   when (null (files a)) exitSuccess   argsToOutput a +printVersion :: IO ()+printVersion = do+  putStrLn $ "eventlog2html Version: " <> showVersion version+  -- We try to get information about the git repository we're building+  -- from. The .git folder might not be available when building from+  -- Hackage.+  let eitherGi = $$tGitInfoCwdTry+  case eitherGi of+    Left _ -> pure ()+    Right gi -> do+      putStrLn $ "Git Commit:            " <> giHash gi+      putStrLn $ "Git Branch:            " <> giBranch gi  argsToOutput :: Args -> IO () argsToOutput a@Args{files = files', outputFile = Nothing} =
src/Eventlog/Args.hs view
@@ -6,6 +6,7 @@     args   , argsInfo   , Args(..)+  , Option(..)   , Sort(..)   , defaultArgs   ) where@@ -16,6 +17,10 @@ import Data.Semigroup ((<>)) import Control.Applicative (optional) +data Option+  = ShowVersion +  | Run Args+ data Sort = Size | StdDev | Name | Gradient  data Args = Args@@ -38,8 +43,8 @@   , files        :: [String]   } -argParser :: Parser Args-argParser = Args+argParser :: Parser Option+argParser = Run <$> (Args       <$> option parseSort           ( long "sort"          <> help "How to sort the bands.  One of: size (default), stddev, name, gradient."@@ -106,7 +111,7 @@           <> metavar "OUTFILE"))       <*> some (argument str           ( help "Eventlogs (FILE.eventlog will be converted to FILE.html)."-         <> metavar "FILES..." ))+         <> metavar "FILES..." )))  parseSort :: ReadM Sort parseSort = eitherReader $ \s -> case s of@@ -116,18 +121,24 @@   "gradient" -> Right Gradient   _ -> Left "expected one of: size, stddev, name" -args :: IO Args+args :: IO Option args = execParser argsInfo  -defaultArgs :: FilePath -> IO Args+versionParser :: Parser Option+versionParser = flag' ShowVersion+  (  long "version"+  <> short 'v'+  <> help "Show the version of eventlog2html" )++defaultArgs :: FilePath -> IO Option defaultArgs fp = handleParseResult (execParserPure defaultPrefs argsInfo [fp])  -argsInfo :: ParserInfo Args+argsInfo :: ParserInfo Option argsInfo = opts   where-    opts = info (argParser <**> helper)+    opts = info ((argParser <|> versionParser) <**> helper)       ( fullDesc      <> progDesc "Convert eventlogs FILES.eventlog to interactive FILES.html"      <> header "eventlog2html - generate interactive html from eventlogs" )
src/Eventlog/HeapProf.hs view
@@ -1,3 +1,4 @@+{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} {-# LANGUAGE BangPatterns #-} module Eventlog.HeapProf (chunk) where