private static void updateOldestCompactionMetric(String metricName, Long oldestTime) {
    if (oldestTime == null) {
      Metrics.getOrCreateGauge(metricName)
          .set(0);
    } else {
      int oldestAge = (int) ((System.currentTimeMillis() - oldestTime) / 1000L);
      Metrics.getOrCreateGauge(metricName)
          .set(oldestAge);
    }
  }
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