fix(site): always use 95th percentile in progress bar (#5733)

This fixes the issue where the bar flickers from "Up to X seconds
remaining" to "X seconds remaining".
This commit is contained in:
Ammar Bandukwala
2023-01-16 20:31:44 +00:00
committed by GitHub
parent 4420985fad
commit 5f7cce775b
@@ -42,7 +42,7 @@ const estimateFinish = (
return isNaN(max) ? 0 : max
}
const lowGuess = secondsLeft(p50)
// Under-promise, over-deliver with the 95th percentile estimate.
const highGuess = secondsLeft(p95)
const anyMomentNow: [number | undefined, string] = [
@@ -54,11 +54,7 @@ const estimateFinish = (
if (highGuess <= 0) {
return anyMomentNow
}
const diff = highGuess - lowGuess
if (diff < 3) {
// If there is sufficient consistency, keep display simple.
return [p50percent, `${highGuess} seconds remaining...`]
}
return [p50percent, `Up to ${highGuess} seconds remaining...`]
}