performance-metrics: Include 'max' and 'min' in the result

Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
Bo Chen 2022-02-10 15:32:58 -08:00 committed by Rob Bradford
parent a7024074c0
commit e41fe0acae

View File

@ -27,6 +27,8 @@ pub struct PerformanceTestResult {
name: String,
mean: f64,
std_dev: f64,
max: f64,
min: f64,
}
pub struct PerformanceTestControl {
@ -106,11 +108,15 @@ impl PerformanceTest {
let mean = mean(&metrics).unwrap();
let std_dev = std_deviation(&metrics).unwrap();
let max = metrics.clone().into_iter().reduce(f64::max).unwrap();
let min = metrics.clone().into_iter().reduce(f64::min).unwrap();
PerformanceTestResult {
name: self.name.to_string(),
mean,
std_dev,
max,
min,
}
}