private synchronized void updateMeasuredRate() {
        double t = clock.time();
        double timeBucket = Math.floor(t * 2) / 2;
        requestCount = requestCount + 1;
        if (timeBucket > lastTxRateBucket) {
            double currentRate = requestCount / (timeBucket - lastTxRateBucket);
            measuredTxRate = (currentRate * SMOOTH) + (measuredTxRate * (1 - SMOOTH));
            requestCount = 0;
            lastTxRateBucket = timeBucket;
        }
    }
<pre>
t = time()
time_bucket = floor(t * 2) / 2
request_count = request_count + 1
if time_bucket > last_tx_rate_bucket
  current_rate = request_count / (time_bucket - last_tx_rate_bucket)
  measured_tx_rate = (current_rate * SMOOTH) + (measured_tx_rate * (1 - SMOOTH))
  request_count = 0
  last_tx_rate_bucket = time_bucket
</pre>
aws-java-sdk-core/src/main/java/com/amazonaws/internal/TokenBucket.java