Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaste committed May 7, 2024
1 parent 2ed8acc commit dbbbb94
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 32 deletions.
26 changes: 13 additions & 13 deletions bench/cardano-profile/src/Cardano/Benchmarking/Profile/Map.hs
Original file line number Diff line number Diff line change
Expand Up @@ -250,19 +250,6 @@ profilesNoEra = Map.fromList $ map (\p -> (Types.name p, p)) $
, (dish & P.name "dish-10M-plutus" )
]
++
[
(dummy { Types.name = "chainsync-early-alonzo", Types.composition = compSoloChainsync , Types.node = nodeNoTracer nodeChainSyncAlo , Types.tracer = tracerDefault})
, (dummy { Types.name = "chainsync-early-alonzo-notracer", Types.composition = compSoloChainsync , Types.node = nodeNoTracer nodeChainSyncAlo , Types.tracer = tracerDefault})
, (dummy { Types.name = "chainsync-early-alonzo-oldtracing", Types.composition = compSoloChainsync , Types.node = nodeOldTracing $ nodeNoTracer nodeChainSyncAlo, Types.tracer = tracerDefault})
]
++
[
(dummy { Types.name = "chainsync-early-alonzo-p2p", Types.composition = compSoloChainsync , Types.node = nodeNoTracer $ nodeP2P nodeChainSyncAlo , Types.tracer = tracerDefault})
, (dummy { Types.name = "chainsync-early-byron", Types.composition = compSoloChainsync , Types.node = nodeNoTracer nodeChainSyncByr , Types.tracer = tracerDefault})
, (dummy { Types.name = "chainsync-early-byron-notracer", Types.composition = compSoloChainsync , Types.node = nodeNoTracer nodeChainSyncByr , Types.tracer = tracerDefault})
, (dummy { Types.name = "chainsync-early-byron-oldtracing", Types.composition = compSoloChainsync , Types.node = nodeOldTracing $ nodeNoTracer nodeChainSyncByr, Types.tracer = tracerDefault})
]
++
-- No 3 nodes and no "--shutdown-on-slot-synced" and no "--shutdown-on-block-synced"
let k3 = dummy
& P.hosts 3 . P.uniCircle . P.loopback
Expand Down Expand Up @@ -296,6 +283,19 @@ profilesNoEra = Map.fromList $ map (\p -> (Types.name p, p)) $
, (noCliStopNomadPerf & P.name "oldtracing-nomadperf-nop2p" . P.tracerOn . P.oldTracing . P.p2pOff)
]
++
[
(dummy { Types.name = "chainsync-early-alonzo", Types.composition = compSoloChainsync , Types.node = nodeNoTracer nodeChainSyncAlo , Types.tracer = tracerDefault})
, (dummy { Types.name = "chainsync-early-alonzo-notracer", Types.composition = compSoloChainsync , Types.node = nodeNoTracer nodeChainSyncAlo , Types.tracer = tracerDefault})
, (dummy { Types.name = "chainsync-early-alonzo-oldtracing", Types.composition = compSoloChainsync , Types.node = nodeOldTracing $ nodeNoTracer nodeChainSyncAlo, Types.tracer = tracerDefault})
]
++
[
(dummy { Types.name = "chainsync-early-alonzo-p2p", Types.composition = compSoloChainsync , Types.node = nodeNoTracer $ nodeP2P nodeChainSyncAlo , Types.tracer = tracerDefault})
, (dummy { Types.name = "chainsync-early-byron", Types.composition = compSoloChainsync , Types.node = nodeNoTracer nodeChainSyncByr , Types.tracer = tracerDefault})
, (dummy { Types.name = "chainsync-early-byron-notracer", Types.composition = compSoloChainsync , Types.node = nodeNoTracer nodeChainSyncByr , Types.tracer = tracerDefault})
, (dummy { Types.name = "chainsync-early-byron-oldtracing", Types.composition = compSoloChainsync , Types.node = nodeOldTracing $ nodeNoTracer nodeChainSyncByr, Types.tracer = tracerDefault})
]
++
[
(dummy { Types.name = "epoch-transition", Types.composition = compDoubletLoopback , Types.node = nodeEpochTransition , Types.tracer = tracerDefault})
]
Expand Down
79 changes: 60 additions & 19 deletions bench/cardano-profile/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -133,34 +133,75 @@ profilesMap = Tasty.testGroup
case eitherAns of
(Left err) -> fail err
(Right ans) -> do
-- Check all keys first (without this what's below makes no sense!)
assertEqual
("Profile == (decode \"" ++ fp ++ "\")")
("Profile == (decode \"" ++ fp ++ "\") - Keys")
(Map.keys Profiles.profiles)
(Map.keys (ans :: Map.Map String Types.Profile))
-- Check names.
assertEqual
("Profile == (decode \"" ++ fp ++ "\") - Name")
(Map.map
(\p -> Types.composition p)
(\p -> Types.name p)
Profiles.profiles
)
(Map.map
(\p -> Types.composition p)
(\p -> Types.name p)
(ans :: Map.Map String Types.Profile)
)
assertEqual
("Profile == (decode \"" ++ fp ++ "\")")
(Map.map
(\p -> Types.node p)
Profiles.profiles
{--
mapM_
(uncurry $ assertEqual
("Profile == (decode \"" ++ fp ++ "\") - Composition")
)
(Map.map
(\p -> Types.node p)
(ans :: Map.Map String Types.Profile)
(zip
(Map.assocs Profiles.profiles)
(Map.assocs (ans :: Map.Map String Types.Profile))
)
assertEqual
("Profile == (decode \"" ++ fp ++ "\")")
(Map.map
(\p -> Types.tracer p)
Profiles.profiles
--}
-- Show the first profile with differences in the Composition type.
mapM_
(uncurry $ assertEqual
("Profile == (decode \"" ++ fp ++ "\") - Composition")
)
(Map.map
(\p -> Types.tracer p)
(ans :: Map.Map String Types.Profile)
-- Map.Map to keep the key / profile name.
(zip
(Map.assocs $ Map.map
(\p -> Types.composition p) Profiles.profiles
)
(Map.assocs $ Map.map
(\p -> Types.composition p)
(ans :: Map.Map String Types.Profile)
)
)
-- Show the first profile with differences in the Node type.
mapM_
(uncurry $ assertEqual
("Profile == (decode \"" ++ fp ++ "\") - Node")
)
-- Map.Map to keep the key / profile name.
(zip
(Map.assocs $ Map.map
(\p -> Types.node p) Profiles.profiles
)
(Map.assocs $ Map.map
(\p -> Types.node p)
(ans :: Map.Map String Types.Profile)
)
)
-- Show the first profile with differences in the Tracer type.
mapM_
(uncurry $ assertEqual
("Profile == (decode \"" ++ fp ++ "\") - Tracer")
)
-- Map.Map to keep the key / profile name.
(zip
(Map.assocs $ Map.map
(\p -> Types.tracer p) Profiles.profiles
)
(Map.assocs $ Map.map
(\p -> Types.tracer p)
(ans :: Map.Map String Types.Profile)
)
)
]

0 comments on commit dbbbb94

Please sign in to comment.