private void getThreadUsage(MetricsRecordBuilder rb) {
    ThreadCountResult result = getThreadCountResult(threadMXBean);
    rb.addGauge(ThreadsNew, result.threadsNew)
        .addGauge(ThreadsRunnable, result.threadsRunnable)
        .addGauge(ThreadsBlocked, result.threadsBlocked)
        .addGauge(ThreadsWaiting, result.threadsWaiting)
        .addGauge(ThreadsTimedWaiting, result.threadsTimedWaiting)
        .addGauge(ThreadsTerminated, result.threadsTerminated);
  }
JVM and logging related metrics. Ported from Hadoop JvmMetrics.
Mostly used by various servers as a part of the metrics they export.
common/src/java/org/apache/hadoop/hive/common/JvmMetrics.java