Unit safe statistics functions

This commit is contained in:
David Peter authored and David Peter committed 2026-10-05 16:00:35 +02:00
1 parent f342e1f5de
commit 3a2c8ab177
3 files changed
+88 -40

No files matched your search

+3 -4
View File
@@ -22,7 +22,7 @@ use crate::output::progress_bar::{
};
use crate::output::warnings::{OutlierWarningOptions, Warnings};
use crate::parameter::ParameterNameAndValue;
use crate::quantity::{self, const_time_from_seconds, Time, Quantity};
use crate::quantity::{self, const_time_from_seconds, Quantity, Time};
use benchmark_result::BenchmarkResult;
use anyhow::{anyhow, Result};
@@ -421,8 +421,7 @@ impl<'a> Benchmark<'a> {
if matches!(self.options.executor_kind, ExecutorKind::Shell(_))
&& measurements
.wall_clock_times()
.iter()
.any(|&t| t < MIN_EXECUTION_TIME)
.any(|t| t < MIN_EXECUTION_TIME)
{
warnings.push(Warnings::FastExecutionTime);
}
@@ -448,7 +447,7 @@ impl<'a> Benchmark<'a> {
if scores[0] > OUTLIER_THRESHOLD {
warnings.push(Warnings::SlowInitialRun(
measurements.wall_clock_times()[0],
measurements.wall_clock_times().next().unwrap(),
outlier_warning_options,
));
} else if scores.iter().any(|&s| s.abs() > OUTLIER_THRESHOLD) {