mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 16:57:58 +00:00
Add database type for import benchmarks (#5959)
* add database type for impot benchmarks * add backend to name
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user