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 acfe626 commit 19b0a1c
Show file tree
Hide file tree
Showing 5 changed files with 318 additions and 118 deletions.
21 changes: 21 additions & 0 deletions bench/cardano-profile/data/ci-test-bage.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,25 @@
},
"desc": "Miniature dataset, CI-friendly duration, test scale",
"name": "ci-test-bage"



, "genesis": {
"network_magic" : 0
, "single_shot" : false
, "per_pool_balance" : 0
, "funds_balance" : 0
, "utxo" : 0
, "active_slots_coeff" : 0
, "epoch_length" : 0
, "parameter_k" : 0
, "slot_duration" : 0
, "extra_future_offset" : 0
, "pparamsEpoch" : 0
, "delegators" : 0
, "shelley" : {}
, "alonzo" : {}
, "pool_coin" : 0
, "delegator_coin" : 0
}
}
79 changes: 69 additions & 10 deletions bench/cardano-profile/src/Cardano/Benchmarking/Profile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,44 @@

module Cardano.Benchmarking.Profile (
Types.Profile (Profile)
-- Name and description.
, name, desc
, loopback, nomadPerf

-- Composition topology.
, uniCircle, torus, torusDense
-- Composition location.
, loopback, nomadPerf
-- Composition size.
, hosts, pools, hostsChainsync, withExplorerNode
, withChaindbServer

-- Genesis
, utxo, delegators, epochLength, parameterK

-- Scenario.
, idle, tracerOnly, fixedLoaded, chainsync

-- Node's --shutdown-on-*-sync.
, shutdownOnSlot, shutdownOnBlock, shutdownOnOff
-- Node's p2p flag.
, p2pOn, p2pOff
-- Node's tracer flag.
, tracerOn, tracerOff
-- Node's tracer type.
, newTracing, oldTracing
-- Node's RTS params.
, rtsGcNonMoving, rtsGcAllocSize, rtsThreads

-- Tracer's params.
, tracerRtview, tracerWithresources

-- Generator params.
, generatorTps

-- Analysis params.
, analysisOff, analysisStandard, analysisPerformance
, analysisSizeSmall, analysisSizeModerate, analysisSizeFull
, analysisUnitary, analysisEpoch3Plus
) where

import Prelude hiding (id)
Expand All @@ -43,6 +67,15 @@ desc str = \p -> p {Types.desc = Just str}
comp :: (Types.Composition -> Types.Composition) -> Types.Profile -> Types.Profile
comp f p = p {Types.composition = f (Types.composition p)}

uniCircle :: Types.Profile -> Types.Profile
uniCircle = comp (\c -> c {Types.topology = Types.UniCircle})

torus :: Types.Profile -> Types.Profile
torus = comp (\c -> c {Types.topology = Types.Torus})

torusDense :: Types.Profile -> Types.Profile
torusDense = comp (\c -> c {Types.topology = Types.TorusDense})

loopback :: Types.Profile -> Types.Profile
loopback = comp (\c -> c {
Types.locations = [Types.Loopback]
Expand All @@ -57,15 +90,6 @@ nomadPerf = comp (\c -> c {
]
})

uniCircle :: Types.Profile -> Types.Profile
uniCircle = comp (\c -> c {Types.topology = Types.UniCircle})

torus :: Types.Profile -> Types.Profile
torus = comp (\c -> c {Types.topology = Types.Torus})

torusDense :: Types.Profile -> Types.Profile
torusDense = comp (\c -> c {Types.topology = Types.TorusDense})

hosts :: Int -> Types.Profile -> Types.Profile
hosts size = comp (\c -> c {
Types.n_bft_hosts = 0
Expand Down Expand Up @@ -113,6 +137,23 @@ withChaindbServer = comp (\c -> c {Types.with_chaindb_server = Just True})

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

genesis :: (Types.Genesis -> Types.Genesis) -> Types.Profile -> Types.Profile
genesis f p = p {Types.genesis = f (Types.genesis p)}

utxo :: Int -> Types.Profile -> Types.Profile
utxo i = genesis (\g -> g {Types.utxo = i})

delegators :: Int -> Types.Profile -> Types.Profile
delegators i = genesis (\g -> g {Types.delegators = i})

epochLength :: Int -> Types.Profile -> Types.Profile
epochLength i = genesis (\g -> g {Types.epoch_length = i})

parameterK :: Int -> Types.Profile -> Types.Profile
parameterK i = genesis (\g -> g {Types.parameter_k = i})

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

idle :: Types.Profile -> Types.Profile
idle p = p {Types.scenario = Types.Idle}

Expand Down Expand Up @@ -207,4 +248,22 @@ analysisStandard = analysis (\a -> a {Types.analysisType = Just "standard"})
analysisPerformance :: Types.Profile -> Types.Profile
analysisPerformance = analysis (\a -> a {Types.analysisType = Just "performance"})

analysisFiltersAppend :: String -> Types.Profile -> Types.Profile
analysisFiltersAppend str = analysis (\a -> a {Types.filters = (Types.filters a) ++ [str]})

analysisSizeSmall :: Types.Profile -> Types.Profile
analysisSizeSmall = analysisFiltersAppend "size-small"

analysisSizeModerate :: Types.Profile -> Types.Profile
analysisSizeModerate = analysisFiltersAppend "size-moderate"

analysisSizeFull :: Types.Profile -> Types.Profile
analysisSizeFull = analysisFiltersAppend "size-full"

analysisUnitary :: Types.Profile -> Types.Profile
analysisUnitary = analysisFiltersAppend "unitary"

analysisEpoch3Plus :: Types.Profile -> Types.Profile
analysisEpoch3Plus = analysisFiltersAppend "epoch3+"

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

0 comments on commit 19b0a1c

Please sign in to comment.