HADOOP-9560. Merge change 1482372 from trunk.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1482380 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Suresh Srinivas 2013-05-14 15:18:03 +00:00
parent 0e7dec2b39
commit 4fb60e81e5
3 changed files with 7 additions and 1 deletions

View File

@ -60,6 +60,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 class JvmMetrics implements MetricsSource {
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"),