@Override
  public void getMetrics(MetricsCollector collector, boolean all) {
    MetricsRecordBuilder rb = collector.addRecord(JvmMetrics)
        .setContext("jvm").tag(ProcessName, processName)
        .tag(SessionId, sessionId);
    getMemoryUsage(rb);
    getGcUsage(rb);
    getThreadUsage(rb);
  }
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