in core/src/main/java/com/spotify/metrics/core/LockFreeExponentiallyDecayingReservoir.java [185:193]
private State rescaleIfNeeded(long currentTick) {
// This method is optimized for size so the check may be quickly inlined.
// Rescaling occurs substantially less frequently than the check itself.
State stateSnapshot = this.state;
if (currentTick - stateSnapshot.startTick >= rescaleThresholdNanos) {
return doRescale(currentTick, stateSnapshot);
}
return stateSnapshot;
}