Add database type for import benchmarks (#5959)

* add database type for impot benchmarks

* add backend to name
This commit is contained in:
Nikolay Volf
2020-05-10 14:23:50 +03:00
committed by GitHub
parent c298b61375
commit 08302bc556
3 changed files with 75 additions and 21 deletions
+14 -5
View File
@@ -26,7 +26,7 @@ use crate::core::{run_benchmark, Mode as BenchmarkMode};
use crate::tempdb::DatabaseType;
use import::{ImportBenchmarkDescription, SizeType};
use trie::{TrieReadBenchmarkDescription, TrieWriteBenchmarkDescription, DatabaseSize};
use node_testing::bench::{Profile, KeyTypes, BlockType};
use node_testing::bench::{Profile, KeyTypes, BlockType, DatabaseType as BenchDataBaseType};
use structopt::StructOpt;
#[derive(Debug, StructOpt)]
@@ -90,18 +90,21 @@ fn main() {
BlockType::RandomTransfersReaping(txs),
BlockType::Noop(txs),
].iter() {
import_benchmarks.push((profile.clone(), size.clone(), block_type.clone()));
for database_type in [BenchDataBaseType::RocksDb, BenchDataBaseType::ParityDb].iter() {
import_benchmarks.push((profile, size, block_type.clone(), database_type));
}
}
}
}
let benchmarks = matrix!(
(profile, size, block_type) in import_benchmarks.iter() =>
(profile, size, block_type, database_type) in import_benchmarks.into_iter() =>
ImportBenchmarkDescription {
profile: *profile,
key_types: KeyTypes::Sr25519,
size: *size,
block_type: *block_type,
block_type: block_type,
database_type: *database_type,
},
(size, db_type) in
[
@@ -128,8 +131,14 @@ fn main() {
);
if opt.list {
println!("Available benchmarks:");
if let Some(filter) = opt.filter.as_ref() {
println!("\t(filtered by \"{}\")", filter);
}
for benchmark in benchmarks.iter() {
log::info!("{}: {}", benchmark.name(), benchmark.path().full())
if opt.filter.as_ref().map(|f| benchmark.path().has(f)).unwrap_or(true) {
println!("{}: {}", benchmark.name(), benchmark.path().full())
}
}
return;
}