code: public synchronized float probesPerSecond() {
  
      Instant now = new Instant();
  
      Instant event = null;
      int events = 0;
      boolean done = false;
      long timeWindow = 0;
      long oldestTime = 0;
  
      do {
        event = messages.poll();
        if (event != null) {
          events++;
          if (events == 1)
            oldestTime = event.getMillis();
          done = event.getMillis() >= now.getMillis();
        } else {
          done = true;
        }
      } while (!done);
  
      timeWindow = now.getMillis() - oldestTime;
  
      float mps = (float) events / timeWindow;
      mps = (float) (mps * 1000.0);
  
      return mps;
  
    }
docs: Calculates the number of probes per second over the last 1000 probes.
  
  @return probes per second