Skip to content

Commit

Permalink
bench-e2e: make loadDataset and saveDataset symmetric
Browse files Browse the repository at this point in the history
  • Loading branch information
locallycompact committed Dec 4, 2023
1 parent c75b02e commit 554df1a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions hydra-cluster/bench/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ main =
Right shelleyGenesis ->
pure $ fromLedgerPParams ShelleyBasedEraShelley (sgProtocolParams shelleyGenesis)
dataset <- generateConstantUTxODataset pparams (fromIntegral clusterSize) numberOfTxs
saveDataset benchDir dataset
saveDataset (benchDir </> "dataset.cbor") dataset
run outputDirectory timeoutSeconds startingNodeId [(dataset, benchDir)]

replay outputDirectory timeoutSeconds startingNodeId benchDir = do
Expand Down Expand Up @@ -84,10 +84,9 @@ main =
readFileBS f >>= either (die . show) pure . (decodeFull . LBS.fromStrict . Base16.decodeLenient)

saveDataset :: FilePath -> Dataset -> IO ()
saveDataset tmpDir dataset = do
let txsFile = tmpDir </> "dataset.cbor"
putStrLn $ "Writing dataset to: " <> txsFile
writeFileBS txsFile $ Base16.encode $ LBS.toStrict $ serialize dataset
saveDataset f dataset = do
putStrLn $ "Writing dataset to: " <> f
writeFileBS f $ Base16.encode $ LBS.toStrict $ serialize dataset

data BenchmarkFailed
= TestFailed HUnitFailure
Expand Down

0 comments on commit 554df1a

Please sign in to comment.