code: public int tally() {
          long currentTimeMillis = clock.currentTimeMillis();
  
          // calculates time for which we remove any errors before
          final long removeTimesBeforeMillis = currentTimeMillis - windowMillis;
  
          synchronized (queue) {
              // drain out any expired timestamps but don't drain past empty
              while (!queue.isEmpty() && queue.peek() < removeTimesBeforeMillis) {
                  queue.removeFirst();
              }
              return queue.size();
          }
      }
docs: Returns a count of in-window events.
  
  @return the the count of in-window events.