@Test
    void testRegulateIncreaseWithFullHistory() {
        // Inject 64 entries into the queue (top 4: 100, 90, 80, 70)
        EvictingQueue<Double> queue = getSuccessRateQueue();
        queue.add((double) mbpsToBps(100.0));
        queue.add((double) mbpsToBps(90.0));
        queue.add((double) mbpsToBps(80.0));
        queue.add((double) mbpsToBps(70.0));
        for (int i = 0; i < 60; i++) {
            queue.add((double) mbpsToBps(60.0));
        }
        // Setup current rate 80 MB/s, failure rate 0, success rate 0
        when(rateLimiter.currentRate()).thenReturn(mbpsToBps(80.0));
        when(successMonitor.getRateAndReset()).thenReturn(0.0);
        when(failureMonitor.getRateAndReset()).thenReturn(0.0);
        regulator.regulate();
        // Expected new rate: 85 MB/s (mean of top 4 entries)
        long expectedNewRate = mbpsToBps(85.0);
        verify(rateLimiter).update(expectedNewRate);
        verify(volumeLimiter).update(expectedNewRate * getWindowSize());
    }
Converts a rate given in KB/s to bytes/s.
s3stream/src/test/java/com/automq/stream/s3/operator/TrafficRegulatorTest.java