Regression algorithm for runtime benchmarks (#5288)

* Add linregress

* Regression, initial stuff.

* More analytics

* whitespace

* Fix

* Median slopes regression algo

* Warnings

* Update to lastest benchmark changes.

* Use both algorithms temp.

* Move analysis to frame.

* Fix tests.

* Only build analysis in std

Co-authored-by: Gav Wood <gavin@parity.io>
This commit is contained in:
Marcio Diaz
2020-03-23 14:07:25 +01:00
committed by GitHub
parent 14249913a6
commit 0c10687022
5 changed files with 365 additions and 2 deletions
@@ -22,7 +22,7 @@ use sc_client_db::BenchmarkingState;
use sc_service::{Configuration, ChainSpec};
use sc_executor::{NativeExecutor, NativeExecutionDispatch};
use codec::{Encode, Decode};
use frame_benchmarking::BenchmarkResults;
use frame_benchmarking::{BenchmarkResults, Analysis};
use sp_core::{
tasks,
traits::KeystoreExt,
@@ -163,6 +163,17 @@ impl BenchmarkCmd {
print!("{:?},{:?}\n", result.1, result.2);
});
print!("\n");
// Conduct analysis.
if let Some(analysis) = Analysis::median_slopes(&results) {
println!("Median Slopes Analysis\n========\n{}", analysis);
}
if let Some(analysis) = Analysis::min_squares_iqr(&results) {
println!("Min Squares Analysis\n========\n{}", analysis);
}
eprintln!("Done.");
}
Err(error) => eprintln!("Error: {:?}", error),