HADOOP-9560. metrics2#JvmMetrics should have max memory size of JVM. Contributed by Tsuyoshi Ozawa.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1482372 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Suresh Srinivas 2013-05-14 15:09:55 +00:00
parent 8a4ff65b3c
commit d89fd7b84f
3 changed files with 7 additions and 1 deletions

View File

@ -615,6 +615,9 @@ Release 2.0.5-beta - UNRELEASED
and RandomAccessFile) in SecureIOUtils so as to help YARN-578. (Omkar Vinit
Joshi via vinodkv)
HADOOP-9560. metrics2#JvmMetrics should have max memory size of JVM.
(Tsuyoshi Ozawa via suresh)
OPTIMIZATIONS
HADOOP-9150. Avoid unnecessary DNS resolution attempts for logical URIs

View File

@ -98,10 +98,12 @@ public void getMetrics(MetricsCollector collector, boolean all) {
private void getMemoryUsage(MetricsRecordBuilder rb) {
MemoryUsage memNonHeap = memoryMXBean.getNonHeapMemoryUsage();
MemoryUsage memHeap = memoryMXBean.getHeapMemoryUsage();
Runtime runtime = Runtime.getRuntime();
rb.addGauge(MemNonHeapUsedM, memNonHeap.getUsed() / M)
.addGauge(MemNonHeapCommittedM, memNonHeap.getCommitted() / M)
.addGauge(MemHeapUsedM, memHeap.getUsed() / M)
.addGauge(MemHeapCommittedM, memHeap.getCommitted() / M);
.addGauge(MemHeapCommittedM, memHeap.getCommitted() / M)
.addGauge(MemMaxM, runtime.maxMemory() / M);
}
private void getGcUsage(MetricsRecordBuilder rb) {

View File

@ -34,6 +34,7 @@ public enum JvmMetricsInfo implements MetricsInfo {
MemNonHeapCommittedM("Non-heap memory committed in MB"),
MemHeapUsedM("Heap memory used in MB"),
MemHeapCommittedM("Heap memory committed in MB"),
MemMaxM("Max memory size in MB"),
GcCount("Total GC count"),
GcTimeMillis("Total GC time in milliseconds"),
ThreadsNew("Number of new threads"),