public void cleanupPerfLogMetrics() {
    for (Timer.Context context : timerContexts.values()) {
      context.close();
    }
    timerContexts.clear();
    if (totalApiCallsTimerContext != null) {
      totalApiCallsTimerContext.close();
      totalApiCallsTimerContext = null;
    }
  }
Cleans up any dangling perfLog metric call scopes.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/metrics/PerfLogger.java