@Override
    synchronized public void run() {
      try {
        RegionMetricAggregate newVal = new RegionMetricAggregate(aggregate);
        newVal.aggregate(regionServer, requestsCountCache);

        // Compute the number of requests per second
        long currentTime = EnvironmentEdgeManager.currentTime();

        // assume that it took PERIOD seconds to start the executor.
        // this is a guess but it's a pretty good one.
        if (lastRan == 0) {
          lastRan = currentTime - period;
        }

        long timeSinceLastRun = currentTime - lastRan;
        // If we've time traveled keep the last requests per second.
        if (timeSinceLastRun > 0) {
          newVal.updateRates(timeSinceLastRun, period, lastStoreFileSize);
        }

        aggregate = newVal;

        List<WALProvider> providers = regionServer.getWalFactory().getAllWALProviders();
        long numWALFilesTmp = 0;
        long walFileSizeTmp = 0;
        for (WALProvider provider : providers) {
          numWALFilesTmp += provider.getNumLogFiles();
          walFileSizeTmp += provider.getLogFileSize();
        }
        numWALFiles = numWALFilesTmp;
        walFileSize = walFileSizeTmp;

        mobFileCacheAccessCount = mobFileCache != null ? mobFileCache.getAccessCount() : 0L;
        mobFileCacheMissCount = mobFileCache != null ? mobFileCache.getMissCount() : 0L;
        mobFileCacheHitRatio = mobFileCache != null ? mobFileCache.getHitRatio() : 0.0;
        if (Double.isNaN(mobFileCacheHitRatio)) {
          mobFileCacheHitRatio = 0.0;
        }
        mobFileCacheEvictedCount = mobFileCache != null ? mobFileCache.getEvictedFileCount() : 0L;
        mobFileCacheCount = mobFileCache != null ? mobFileCache.getCacheSize() : 0;

        lastStoreFileSize = aggregate.storeFileSize;
        lastRan = currentTime;
      } catch (Throwable e) {
        LOG.warn("Caught exception! Will suppress and retry.", e);
      }
    }
This is the runnable that will be executed on the executor every PERIOD number of seconds It
will take metrics/numbers from all of the regions and use them to compute point in time
metrics.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapperImpl.java