@Override
  public void run() {
    LOG.debug("Starting AcidMetricService thread");
    try {
      if (!metricsEnabled) {
        return;
      }
      long startedAt = System.currentTimeMillis();
        try {
          updateMetrics();
          updateDeltaMetrics();
        } catch (Exception ex) {
         LOG.error("Caught exception in AcidMetricService loop", ex);
        }

        long elapsedTime = System.currentTimeMillis() - startedAt;
        LOG.debug("AcidMetricService thread finished one loop in {} seconds.", elapsedTime / 1000);

    } catch (Throwable t) {
      LOG.error("Caught an exception in the main loop of AcidMetricService, exiting ", t);
    }
  }
Collect and publish ACID and compaction related metrics.
Everything should be behind 2 feature flags: {@link MetastoreConf.ConfVars#METRICS_ENABLED} and
{@link MetastoreConf.ConfVars#METASTORE_ACIDMETRICS_THREAD_ON}.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/metrics/AcidMetricService.java