public static Timer getOrCreateTimer(String name) {
    if (self == null) return null;
    Map<String, Timer> timers = self.registry.getTimers();
    Timer timer = timers.get(name);
    if (timer != null) return timer;
    synchronized (Metrics.class) {
      timers = self.registry.getTimers();
      timer = timers.get(name);
      if (timer != null) return timer;
      return self.registry.timer(name);
    }
  }
Get an existing timer or create a new one if the requested one does not yet exist.  Creation
is synchronized to assure that only one instance of the counter is created.
@param name timer name
@return new Timer, or existing one if it already exists, null if the metrics have not been
initialized.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/metrics/Metrics.java