Additional benchmark-storage flags (#11004)

* Fix typos

* Enable overwriting handlebars template

* Optionally name json output or disable json altogether

* Don't write to json by default

* Include block id in handlebars output

* Include warmups for write benchmarks

* PR comments

* Drop unnecessary file extension

* Use more appropriate types

* Use more appropriate error message

* More use of more appropriate types

* Rework write benchmark warmups

* Run same benchmark for both read and write
This commit is contained in:
Daan Schutte
2022-03-15 17:21:16 +03:00
committed by GitHub
parent 814ad34a4c
commit 1c1c1f4566
6 changed files with 93 additions and 30 deletions
@@ -49,17 +49,6 @@ impl StorageCmd {
let mut rng = Self::setup_rng();
keys.shuffle(&mut rng);
// Run some rounds of the benchmark as warmup.
for i in 0..self.params.warmups {
info!("Warmup round {}/{}", i + 1, self.params.warmups);
for key in keys.clone() {
let _ = client
.storage(&block, &key)
.expect("Checked above to exist")
.ok_or("Value unexpectedly empty")?;
}
}
// Interesting part here:
// Read all the keys in the database and measure the time it takes to access each.
info!("Reading {} keys", keys.len());