code: private EventCount trimAndSum(long tickerNanos) {
          final long oldLimit = tickerNanos - slidingWindowNanos;
          final Iterator<Bucket> iterator = reservoir.iterator();
          long success = 0;
          long failure = 0;
          while (iterator.hasNext()) {
              final Bucket bucket = iterator.next();
              if (bucket.timestamp < oldLimit) {
                  // removes old bucket
                  iterator.remove();
              } else {
                  success += bucket.success();
                  failure += bucket.failure();
              }
          }
  
          return new EventCount(success, failure);
      }
docs: Sums up buckets within the time window, and removes all the others.