diff --git a/bench/locli/CHANGELOG.md b/bench/locli/CHANGELOG.md new file mode 100644 index 00000000000..7b5339b4dba --- /dev/null +++ b/bench/locli/CHANGELOG.md @@ -0,0 +1,8 @@ +# Revision history for locli + +## 1.36 -- Nov 2024 + +* Add `CHANGELOG.md` for `locli` +* Discern Plutus RIPEMD-160 workload in reports +* Remove unused build-depends + diff --git a/bench/locli/locli.cabal b/bench/locli/locli.cabal index e5f1bd3b52d..dc5afb96e08 100644 --- a/bench/locli/locli.cabal +++ b/bench/locli/locli.cabal @@ -1,7 +1,7 @@ cabal-version: 3.0 name: locli -version: 1.35 +version: 1.36 synopsis: Cardano log analysis CLI description: Cardano log analysis CLI. category: Cardano, @@ -12,6 +12,7 @@ maintainer: operations@iohk.io license: Apache-2.0 license-files: LICENSE NOTICE +extra-doc-files: CHANGELOG.md build-type: Simple common project-config @@ -95,11 +96,8 @@ library autogen-modules: Paths_locli build-depends: aeson - , Histogram , aeson-pretty , async - , attoparsec - , attoparsec-iso8601 , bytestring , cardano-git-rev ^>= 0.2.2 , cardano-ledger-core @@ -110,27 +108,17 @@ library , directory , ede , extra - , file-embed , filepath , fingertree , hashable - , gnuplot - , iohk-monitoring - , optparse-applicative-fork - , optparse-generic + -- , gnuplot + , optparse-applicative-fork >= 0.18.1 , ouroboros-consensus - -- for Data.SOP.Strict: - , ouroboros-network ^>= 0.17 - , ouroboros-network-api - , process - , quiet - , scientific + , ouroboros-network-api ^>= 0.10 , sop-core , split , statistics , strict-sop-core - , system-filepath - , template-haskell , text , text-short , time @@ -139,10 +127,8 @@ library , transformers-except , unix , unordered-containers - , utf8-string , vector , witherable - , cardano-strict-containers ^>= 0.1 executable locli import: project-config @@ -150,7 +136,6 @@ executable locli hs-source-dirs: app main-is: locli.hs ghc-options: -threaded - -Wall -rtsopts "-with-rtsopts=-T -N7 -A2m -qb -H64m" diff --git a/bench/locli/src/Cardano/Analysis/API/Ground.hs b/bench/locli/src/Cardano/Analysis/API/Ground.hs index d09abe5bf6d..005108b4946 100644 --- a/bench/locli/src/Cardano/Analysis/API/Ground.hs +++ b/bench/locli/src/Cardano/Analysis/API/Ground.hs @@ -10,14 +10,12 @@ module Cardano.Analysis.API.Ground ) where -import Prelude (show) +import Prelude as P (show) import Cardano.Prelude hiding (head, toText) import Unsafe.Coerce qualified as Unsafe import Data.Aeson import Data.Aeson.Types (toJSONKeyText) -import Data.Attoparsec.Text qualified as Atto -import Data.Attoparsec.Time qualified as Iso8601 import Data.ByteString.Lazy.Char8 qualified as LBS import Data.Map.Strict qualified as Map import Data.Text qualified as T @@ -26,7 +24,6 @@ import Data.Text.Short (ShortText, fromText, toText) import Data.Time.Clock (UTCTime, NominalDiffTime) import Options.Applicative import Options.Applicative qualified as Opt -import Quiet (Quiet (..)) import System.FilePath qualified as F import Cardano.Slotting.Slot (EpochNo(..), SlotNo(..)) @@ -41,13 +38,17 @@ newtype FieldName = FieldName { unFieldName :: Text } deriving (Eq, Generic, Ord) deriving newtype (FromJSON, IsString, ToJSON) deriving anyclass NFData - deriving Show via Quiet FieldName + +instance Show FieldName where + show = ("FieldName " ++) . P.show . unFieldName newtype TId = TId { unTId :: ShortText } deriving (Eq, Generic, Ord) deriving newtype (FromJSON, ToJSON) deriving anyclass NFData - deriving Show via Quiet TId + +instance Show TId where + show = ("TId " ++) . P.show . unTId newtype Hash = Hash { unHash :: ShortText } deriving (Eq, Generic, Ord) @@ -95,7 +96,9 @@ newtype Host = Host { unHost :: ShortText } deriving (Eq, Generic, Ord) deriving newtype (IsString, FromJSON, ToJSON) deriving anyclass NFData - deriving Show via Quiet Host + +instance Show Host where + show = ("Host " ++) . P.show . unHost newtype EpochSlot = EpochSlot { unEpochSlot :: Word64 } deriving stock (Eq, Generic, Ord, Show) @@ -269,26 +272,6 @@ pSlotNo name desc = <> Opt.help desc ) -optUTCTime :: String -> String -> Parser UTCTime -optUTCTime optname desc = - Opt.option (readerFromAttoParser Iso8601.utcTime) - $ long optname - <> metavar "ISO8601-TIME" - <> help desc - where - -- Stolen from: cardano-cli/src/Cardano/CLI/Shelley/Parsers.hs - readerFromAttoParser :: Atto.Parser a -> Opt.ReadM a - readerFromAttoParser p = - Opt.eitherReader (Atto.parseOnly (p <* Atto.endOfInput) . T.pack) - -optDuration :: String -> String -> NominalDiffTime -> Parser NominalDiffTime -optDuration optname desc def= - Opt.option ((realToFrac :: Double -> NominalDiffTime) <$> Opt.auto) - $ long optname - <> metavar "SEC" - <> help desc - <> value def - optWord :: String -> String -> Word64 -> Parser Word64 optWord optname desc def = Opt.option auto diff --git a/bench/locli/src/Cardano/Report.hs b/bench/locli/src/Cardano/Report.hs index 16fc89e3c5f..de03da69b25 100644 --- a/bench/locli/src/Cardano/Report.hs +++ b/bench/locli/src/Cardano/Report.hs @@ -80,6 +80,7 @@ data Workload | WPlutusLoopCountdown | WPlutusLoopSECP | WPlutusLoopBLST + | WPlutusLoopRipemd | WPlutusUnknown instance ToJSON Workload where @@ -88,6 +89,7 @@ instance ToJSON Workload where WPlutusLoopCountdown -> "Plutus countdown loop" WPlutusLoopSECP -> "Plutus SECP loop" WPlutusLoopBLST -> "Plutus BLST loop" + WPlutusLoopRipemd -> "Plutus RIPEMD-160 loop" WPlutusUnknown -> "Plutus (other)" filenameInfix :: Workload -> Text @@ -95,6 +97,7 @@ filenameInfix = \case WPlutusLoopCountdown -> "plutus" WPlutusLoopSECP -> "plutus-secp" WPlutusLoopBLST -> "plutus-blst" + WPlutusLoopRipemd -> "plutus-ripemd" WValue -> "value-only" _ -> "unknown" @@ -150,6 +153,7 @@ liftTmplRun Summary{sumWorkload=generatorProfile | script == "EcdsaSecp256k1Loop" -> WPlutusLoopSECP | script == "SchnorrSecp256k1Loop" -> WPlutusLoopSECP | script == "HashOntoG2AndAdd" -> WPlutusLoopBLST + | script == "Ripemd160" -> WPlutusLoopRipemd | otherwise -> WPlutusUnknown }