Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaste committed May 10, 2024
1 parent ea8b81e commit ba25f5b
Show file tree
Hide file tree
Showing 7 changed files with 747 additions and 300 deletions.
12 changes: 10 additions & 2 deletions bench/cardano-profile/app/cardano-profile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ main = do
cliParser
( OA.fullDesc
<> OA.progDesc "Cardano benchmarking profile generator"
<> OA.header "make PROFILE_NAME | from-json FILE.json | to-json FILE.hs"
<> OA.header "all | make PROFILE_NAME | from-json FILE.json | to-json FILE.hs"
)
)
case cli of
All -> print Map.profiles
(Make profileName) -> BSL8.putStrLn $ Aeson.encode $ Map.byName profileName
(ToJson filePath) -> print filePath
-- str <- readFile filePath
Expand All @@ -45,10 +46,17 @@ main = do

--------------------------------------------------------------------------------

data Cli = Make String | ToJson String | FromJson String
data Cli = All | Make String | ToJson String | FromJson String

cliParser :: OA.Parser Cli
cliParser = OA.hsubparser $
(OA.command "all"

Check warning on line 53 in bench/cardano-profile/app/cardano-profile.hs

View workflow job for this annotation

GitHub Actions / build

Suggestion in cliParser in module Main: Redundant bracket ▫︎ Found: "(OA.command\n \"all\"\n (OA.info\n (pure All)\n (OA.fullDesc <> OA.header \"all\" <> OA.progDesc \"All profiles\")))\n <>\n (OA.command\n \"make\"\n (OA.info\n (Make <$> OA.argument OA.str (OA.metavar \"PROFILE-NAME\"))\n (OA.fullDesc <> OA.header \"make\" <> OA.progDesc \"Create profile\")))\n <>\n (OA.command\n \"to-json\"\n (OA.info\n (ToJson <$> OA.argument OA.str (OA.metavar \"FILE\"))\n (OA.fullDesc\n <> OA.header \"to-json\" <> OA.progDesc \"Data type to JSON\")))\n <>\n (OA.command\n \"from-json\"\n (OA.info\n (FromJson <$> OA.argument OA.str (OA.metavar \"FILE\"))\n (OA.fullDesc\n <> OA.header \"from-json\" <> OA.progDesc \"JSON to data type\")))" ▫︎ Perhaps: "OA.command\n \"all\"\n (OA.info\n (pure All)\n (OA.fullDesc <> OA.header \"all\" <> OA.progDesc \"All profiles\"))\n <>\n (OA.command\n \"make\"\n (OA.info\n (Make <$> OA.argument OA.str (OA.metavar \"PROFILE-NAME\"))\n (OA.fullDesc <> OA.header \"make\" <> OA.progDesc \"Create profile\")))\n <>\n (OA.command\n \"to-json\"\n (OA.info\n (ToJson <$> OA.argument OA.str (OA.metavar \"FILE\"))\n (OA.fullDesc\n <> OA.header \"to-json\" <> OA.progDesc \"Data type to JSON\")))\n <>\n (OA.command\n \"from-json\"\n (OA.info\n (FromJson <$> OA.argument OA.str (OA.metavar \"FILE\"))\n (OA.fullDesc\n <> OA.header \"from-json\" <> OA.progDesc \"JSON to data type\")))"
(OA.info
(pure All)
(OA.fullDesc <> OA.header "all" <> OA.progDesc "All profiles")
)
)
<>
(OA.command "make"

Check warning on line 60 in bench/cardano-profile/app/cardano-profile.hs

View workflow job for this annotation

GitHub Actions / build

Suggestion in cliParser in module Main: Redundant bracket ▫︎ Found: "(OA.command\n \"make\"\n (OA.info\n (Make <$> OA.argument OA.str (OA.metavar \"PROFILE-NAME\"))\n (OA.fullDesc <> OA.header \"make\" <> OA.progDesc \"Create profile\")))\n <>\n (OA.command\n \"to-json\"\n (OA.info\n (ToJson <$> OA.argument OA.str (OA.metavar \"FILE\"))\n (OA.fullDesc\n <> OA.header \"to-json\" <> OA.progDesc \"Data type to JSON\")))\n <>\n (OA.command\n \"from-json\"\n (OA.info\n (FromJson <$> OA.argument OA.str (OA.metavar \"FILE\"))\n (OA.fullDesc\n <> OA.header \"from-json\" <> OA.progDesc \"JSON to data type\")))" ▫︎ Perhaps: "OA.command\n \"make\"\n (OA.info\n (Make <$> OA.argument OA.str (OA.metavar \"PROFILE-NAME\"))\n (OA.fullDesc <> OA.header \"make\" <> OA.progDesc \"Create profile\"))\n <>\n (OA.command\n \"to-json\"\n (OA.info\n (ToJson <$> OA.argument OA.str (OA.metavar \"FILE\"))\n (OA.fullDesc\n <> OA.header \"to-json\" <> OA.progDesc \"Data type to JSON\")))\n <>\n (OA.command\n \"from-json\"\n (OA.info\n (FromJson <$> OA.argument OA.str (OA.metavar \"FILE\"))\n (OA.fullDesc\n <> OA.header \"from-json\" <> OA.progDesc \"JSON to data type\")))"
(OA.info
(Make <$> OA.argument OA.str (OA.metavar "PROFILE-NAME"))
Expand Down
1 change: 1 addition & 0 deletions bench/cardano-profile/cardano-profile.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ library
, Cardano.Benchmarking.Profile.Map
, Cardano.Benchmarking.Profile.Types
build-depends: base >=4.12 && <5
, time
, aeson
, bytestring
, containers
Expand Down
21 changes: 20 additions & 1 deletion bench/cardano-profile/data/ci-test-bage.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,26 @@
"desc": "Miniature dataset, CI-friendly duration, test scale",
"name": "ci-test-bage"


, "derived": {
"supply_delegated": 2000000000000000
, "supply_total": 2010000000000000
, "utxo_delegated": 0
, "utxo_generated": 18000
, "utxo_stuffed": 0
, "delegators_effective": 2
, "dataset_measure": 0
, "dataset_induced_startup_delay_optimistic": 40
, "dataset_induced_startup_delay_conservative": 40
, "genesis_future_offset": 40
, "epoch_duration": 600
, "generator_duration": 600
, "shutdown_time": null
, "effective_epochs": 1
, "generator_tx_count": 9000
, "default_value_tx_size_estimate": 381
, "default_value_tx_per_block_estimate": 172
, "generator_blocks_lower_bound": 61
}

, "genesis": {
"network_magic" : 0
Expand Down
Loading

0 comments on commit ba25f5b

Please sign in to comment.