public void refresh(long lastReportTimestamp, long readRequestCount,
    long filteredReadRequestCount, long writeRequestCount) {
    if (previousLastReportTimestamp == 0) {
      previousLastReportTimestamp = lastReportTimestamp;
      previousReadRequestCount = readRequestCount;
      previousFilteredReadRequestCount = filteredReadRequestCount;
      previousWriteRequestCount = writeRequestCount;
    } else if (previousLastReportTimestamp != lastReportTimestamp) {
      long delta = (lastReportTimestamp - previousLastReportTimestamp) / 1000;
      if (delta < 1) {
        delta = 1;
      }
      readRequestCountPerSecond = (readRequestCount - previousReadRequestCount) / delta;
      filteredReadRequestCountPerSecond =
        (filteredReadRequestCount - previousFilteredReadRequestCount) / delta;
      writeRequestCountPerSecond = (writeRequestCount - previousWriteRequestCount) / delta;

      previousLastReportTimestamp = lastReportTimestamp;
      previousReadRequestCount = readRequestCount;
      previousFilteredReadRequestCount = filteredReadRequestCount;
      previousWriteRequestCount = writeRequestCount;
    }
  }
Utility class for calculating request counts per second.
hbase-hbtop/src/main/java/org/apache/hadoop/hbase/hbtop/mode/RequestCountPerSecond.java