code: public synchronized double[] sample() {
          long[] currCounts = counter.sample();
          long now = System.currentTimeMillis();
  
          if (lastSampleMillis != 0) {
              long deltaTime = now - lastSampleMillis;
  
              if (deltaTime == 0) return lastKnownRates;
  
              lastKnownRates[0] = rate(currCounts[0] - lastTotal, deltaTime);
              lastKnownRates[1] = rate(currCounts[1] - lastSuccesses, deltaTime);
              lastKnownRates[2] = rate(currCounts[2] - lastFailures, deltaTime);
          } else {
              lastKnownRates[0] = lastKnownRates[1] = lastKnownRates[2] = 0.0;
          }
  
          lastTotal = currCounts[0];
          lastSuccesses = currCounts[1];
          lastFailures = currCounts[2];
          lastSampleMillis = now;
  
          return lastKnownRates;
      }
docs: Takes a sample of the request rates. Calculations are based on
  differences in request counts since the last call to
  <code>sample()</code>.
  @return an array of three <code>doubles</code>: total requests per
  second, successful requests per second, failed requests per
  second. If this is the first sample, all three rates will be
  reported as zero requests per second.