@VisibleForTesting
  void refreshMetrics(AtomicDouble currentRunningTasksCount, AtomicDouble currentPendingTasksCount) {
    this.runningTasksCount.setValue((int) currentRunningTasksCount.get());
    this.pendingTasksCount.setValue((int) currentPendingTasksCount.get());
    double currentTaskBacklogRatio = (double) this.pendingTasksCount.value / (this.runningTasksCount.value + 1);
    this.taskBacklogRatio.setValue(currentTaskBacklogRatio);

    for (TaskBacklogRatioMetric m : taskBacklogRatioDurations) {
      m.refresh(currentTaskBacklogRatio);
    }
  }
TezSessionPoolManagerMetrics collects, aggregates and exposes data from Tez sessions to Hive's own MetricsFactory.
This is independent of the Tez DagClient which is active only while running DAGs.
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionPoolManagerMetrics.java