mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 14:37:57 +00:00
Add DB Read/Write Tracking to Benchmarking Pipeline (#6386)
* initial mockup * add and wipe * track writes * start to add to pipeline * return all reads/writes * Log reads and writes from bench db * causes panic * Allow multiple commits * commit before ending benchmark * doesn't work??? * fix * Update lib.rs * switch to struct for `BenchmarkResults` * add to output * fix test * line width * @kianenigma review * Add Whitelist to DB Tracking in Benchmarks Pipeline (#6405) * hardcoded whitelist * Add whitelist to pipeline * Remove whitelist pipeline from CLI, add to runtime * clean-up unused db initialized whitelist * Add regression analysis to DB Tracking (#6475) * Add selector * add tests * debug formatter for easy formula * Update client/db/src/bench.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: arkpar <arkady.paronyan@gmail.com> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
|
||||
use crate::BenchmarkCmd;
|
||||
use codec::{Decode, Encode};
|
||||
use frame_benchmarking::{Analysis, BenchmarkBatch};
|
||||
use frame_benchmarking::{Analysis, BenchmarkBatch, BenchmarkSelector};
|
||||
use sc_cli::{SharedParams, CliConfiguration, ExecutionStrategy, Result};
|
||||
use sc_client_db::BenchmarkingState;
|
||||
use sc_executor::NativeExecutor;
|
||||
@@ -107,15 +107,22 @@ impl BenchmarkCmd {
|
||||
|
||||
if self.raw_data {
|
||||
// Print the table header
|
||||
batch.results[0].0.iter().for_each(|param| print!("{:?},", param.0));
|
||||
batch.results[0].components.iter().for_each(|param| print!("{:?},", param.0));
|
||||
|
||||
print!("extrinsic_time,storage_root_time\n");
|
||||
print!("extrinsic_time,storage_root_time,reads,repeat_reads,writes,repeat_writes\n");
|
||||
// Print the values
|
||||
batch.results.iter().for_each(|result| {
|
||||
let parameters = &result.0;
|
||||
let parameters = &result.components;
|
||||
parameters.iter().for_each(|param| print!("{:?},", param.1));
|
||||
// Print extrinsic time and storage root time
|
||||
print!("{:?},{:?}\n", result.1, result.2);
|
||||
print!("{:?},{:?},{:?},{:?},{:?},{:?}\n",
|
||||
result.extrinsic_time,
|
||||
result.storage_root_time,
|
||||
result.reads,
|
||||
result.repeat_reads,
|
||||
result.writes,
|
||||
result.repeat_writes,
|
||||
);
|
||||
});
|
||||
|
||||
println!();
|
||||
@@ -123,13 +130,27 @@ impl BenchmarkCmd {
|
||||
|
||||
// Conduct analysis.
|
||||
if !self.no_median_slopes {
|
||||
if let Some(analysis) = Analysis::median_slopes(&batch.results) {
|
||||
println!("Median Slopes Analysis\n========\n{}", analysis);
|
||||
println!("Median Slopes Analysis\n========");
|
||||
if let Some(analysis) = Analysis::median_slopes(&batch.results, BenchmarkSelector::ExtrinsicTime) {
|
||||
println!("-- Extrinsic Time --\n{}", analysis);
|
||||
}
|
||||
if let Some(analysis) = Analysis::median_slopes(&batch.results, BenchmarkSelector::Reads) {
|
||||
println!("Reads = {:?}", analysis);
|
||||
}
|
||||
if let Some(analysis) = Analysis::median_slopes(&batch.results, BenchmarkSelector::Writes) {
|
||||
println!("Writes = {:?}", analysis);
|
||||
}
|
||||
}
|
||||
if !self.no_min_squares {
|
||||
if let Some(analysis) = Analysis::min_squares_iqr(&batch.results) {
|
||||
println!("Min Squares Analysis\n========\n{}", analysis);
|
||||
println!("Min Squares Analysis\n========");
|
||||
if let Some(analysis) = Analysis::min_squares_iqr(&batch.results, BenchmarkSelector::ExtrinsicTime) {
|
||||
println!("-- Extrinsic Time --\n{}", analysis);
|
||||
}
|
||||
if let Some(analysis) = Analysis::min_squares_iqr(&batch.results, BenchmarkSelector::Reads) {
|
||||
println!("Reads = {:?}", analysis);
|
||||
}
|
||||
if let Some(analysis) = Analysis::min_squares_iqr(&batch.results, BenchmarkSelector::Writes) {
|
||||
println!("Writes = {:?}", analysis);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user