public void endStoredScope(String name) {
    if (threadLocalScopes.get().containsKey(name)) {
      threadLocalScopes.get().get(name).close();
    }
  }
Closes scope if open, and reopens it
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/common/metrics/LegacyMetrics.java