agility: Improve laps per hour calculation accuracy (#12246)

The agility plugin previously calculated the average laps/hr rate based
on the speed of the last 10 completed laps. Since this number was too
low, it regularly resulted in an inaccurate estimate. Increasing this
cache of previous lap speed to 30 yields a good trade-off between
accuracy over a long period of time and responsiveness to laps with
outlier completion times.
This commit is contained in:
Arman Rafian
2020-07-29 20:54:02 -07:00
committed by GitHub
parent a41074f135
commit 04648664ad

View File

@@ -41,7 +41,7 @@ class AgilitySession
private Instant lastLapCompleted;
private int totalLaps;
private int lapsTillGoal;
private final EvictingQueue<Duration> lastLapTimes = EvictingQueue.create(10);
private final EvictingQueue<Duration> lastLapTimes = EvictingQueue.create(30);
private int lapsPerHour;
AgilitySession(Courses course)