private void beginMetrics(String method) {
    Metrics metrics = MetricsFactory.getInstance();
    if (metrics != null) {
      MetricsScope scope = metrics.createScope(MetricsConstant.API_PREFIX + method);
      synchronized (openScopes) {
        openScopes.put(method, scope);
      }
    }

  }
Helper method for getting the time spent to actually run the DAG.
common/src/java/org/apache/hadoop/hive/ql/log/PerfLogger.java