Add test for Profiler::get_statistics, and remove empty space around Profiler::get_statistics.

Profiler::get_statistics calculates mean, median, min, and max for a given vector of data. This commit adds a test for the calculated statistics.
This commit is contained in:
Jeena Lee 2016-07-07 11:00:56 -07:00
parent 6230911330
commit d47b769cf7
2 changed files with 22 additions and 3 deletions

View file

@ -327,8 +327,7 @@ impl Profiler {
true
}
fn get_statistics(data: &[f64]) -> (f64, f64, f64, f64) {
pub fn get_statistics(data: &[f64]) -> (f64, f64, f64, f64) {
let data_len = data.len();
let (mean, median, min, max) =
(data.iter().sum::<f64>() / (data_len as f64),
@ -338,7 +337,6 @@ impl Profiler {
(mean, median, min, max)
}
fn print_buckets(&mut self) {
match self.output {
Some(OutputOptions::FileName(ref filename)) => {