@Override
  public void close() throws Exception {
    if (reporters != null) {
      for (Closeable reporter : reporters) {
        reporter.close();
      }
    }
    for (Map.Entry<String, Metric> metric : metricRegistry.getMetrics().entrySet()) {
      metricRegistry.remove(metric.getKey());
    }
    if (hadoopMetricsStarted) {
      DefaultMetricsSystem.shutdown();
      hadoopMetricsStarted = false;
    }
    timers.invalidateAll();
    counters.invalidateAll();
    meters.invalidateAll();
  }
Closes scope, and records the time taken
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/common/metrics/metrics2/CodahaleMetrics.java