@Override
  public void endStoredScope(String name) {
    if (threadLocalScopes.get().containsKey(name)) {
      threadLocalScopes.get().get(name).close();
      threadLocalScopes.get().remove(name);
    }
  }
Closes scope, and records the time taken
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/common/metrics/metrics2/CodahaleMetrics.java