From 3c8dbdbbb13ca233bd03466de2f0ea4fc4be38d4 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Thu, 20 Aug 2026 18:19:22 +0200 Subject: chore(bench): exclude rides under 10 km --- cli/cli.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cli/cli.go') diff --git a/cli/cli.go b/cli/cli.go index 4459946..cac29ec 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -32,7 +32,7 @@ var ( backtest = flag.Bool("backtest", false, "run data benchmarks comparing computed values against stored reference values") ) -const backtestMinimumElapsedTimeS = 15 * 60 +const backtestMinimumDistanceM = 10_000 func Run(db *sql.DB, configPath string, appConfig config.Config) { switch { @@ -134,12 +134,12 @@ func runBacktest(db *sql.DB) error { fmt.Fprintf(table, "p%g\t%.1f\n", p, distribution[p]) } table.Flush() - slog.Info("Moving time backtest", "rides", len(samples), "min_elapsed_s", backtestMinimumElapsedTimeS, "mean_err_pct", math.Round(meanAbsErr(absErrors)*10)/10, "stderr_pct", math.Round(stdErrAbsErr(absErrors)*10)/10) + slog.Info("Moving time backtest", "rides", len(samples), "min_distance_m", backtestMinimumDistanceM, "mean_err_pct", math.Round(meanAbsErr(absErrors)*10)/10, "stderr_pct", math.Round(stdErrAbsErr(absErrors)*10)/10) return nil } func isBacktestEligible(item rides.Ride) bool { - return item.GPXPath != "" && item.ElapsedTimeS >= backtestMinimumElapsedTimeS && item.MovingTimeS > 0 + return item.GPXPath != "" && item.DistanceM >= backtestMinimumDistanceM && item.MovingTimeS > 0 } func meanAbsErr(absErrors []float64) float64 { -- cgit v1.3