From 0a0c62f384196233a2adf697daae7d8a6020d1b1 Mon Sep 17 00:00:00 2001 From: Pankaj Garg Date: Mon, 7 Jan 2019 14:26:21 -0800 Subject: [PATCH] Fixes to CI bench comparison (#2319) * Fixes to CI bench comparison - The table columns did not match the header - The last commit was not identified correctly * review comments --- upload-perf/src/upload-perf.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/upload-perf/src/upload-perf.rs b/upload-perf/src/upload-perf.rs index 0151cc6e0b..8b794e853e 100644 --- a/upload-perf/src/upload-perf.rs +++ b/upload-perf/src/upload-perf.rs @@ -59,10 +59,9 @@ fn main() { if v["type"] == "bench" { let name = v["name"].as_str().unwrap().trim_matches('\"').to_string(); - last_commit = match get_last_metrics(&"commit".to_string(), &db, &name, &branch) { - Result::Ok(v) => Some(v), - Result::Err(_) => None, - }; + if last_commit.is_none() { + last_commit = get_last_metrics(&"commit".to_string(), &db, &name, &branch).ok(); + } let median = v["median"].to_string().parse().unwrap(); let deviation = v["deviation"].to_string().parse().unwrap(); @@ -99,12 +98,12 @@ fn main() { println!("bench_name, median, last_median, deviation, last_deviation"); for (entry, values) in results { println!( - "{:#10?}, {:#10?}, {:#10?}, {:#10?}, {}", + "{}, {:#10?}, {:#10?}, {:#10?}, {:#10?}", + entry, values.0, values.2.parse::().unwrap(), values.1, values.3.parse::().unwrap(), - entry, ); } } else { @@ -112,7 +111,7 @@ fn main() { println!("hash: {}", trimmed_hash); println!("bench_name, median, deviation"); for (entry, values) in results { - println!("{:10?}, {:10?}, {}", values.0, values.1, entry); + println!("{}, {:10?}, {:10?}", entry, values.0, values.1); } } solana_metrics::flush();