HBASE-3807 Fix units in RS UI metrics

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1156336 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2011-08-10 19:42:30 +00:00
parent 56a0445c8f
commit a0478e5aed
4 changed files with 24 additions and 26 deletions

View File

@ -370,6 +370,7 @@ Release 0.91.0 - Unreleased
HBASE-3899 Add ability for delayed RPC calls to set return value HBASE-3899 Add ability for delayed RPC calls to set return value
immediately at call return. (Vlad Dogaru via todd) immediately at call return. (Vlad Dogaru via todd)
HBASE-4169 FSUtils LeaseRecovery for non HDFS FileSystems (Lohit Vijayarenu) HBASE-4169 FSUtils LeaseRecovery for non HDFS FileSystems (Lohit Vijayarenu)
HBASE-3807 Fix units in RS UI metrics (subramanian raghunathan)
TASKS TASKS
HBASE-3559 Move report of split to master OFF the heartbeat channel HBASE-3559 Move report of split to master OFF the heartbeat channel

View File

@ -312,9 +312,9 @@ implements WritableComparable<HServerLoad> {
*/ */
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = Strings.appendKeyValue(new StringBuilder(), "stores", StringBuilder sb = Strings.appendKeyValue(new StringBuilder(), "numberOfStores",
Integer.valueOf(this.stores)); Integer.valueOf(this.stores));
sb = Strings.appendKeyValue(sb, "storefiles", sb = Strings.appendKeyValue(sb, "numberOfStorefiles",
Integer.valueOf(this.storefiles)); Integer.valueOf(this.storefiles));
sb = Strings.appendKeyValue(sb, "storefileUncompressedSizeMB", sb = Strings.appendKeyValue(sb, "storefileUncompressedSizeMB",
Integer.valueOf(this.storeUncompressedSizeMB)); Integer.valueOf(this.storeUncompressedSizeMB));
@ -419,13 +419,13 @@ implements WritableComparable<HServerLoad> {
public String toString(int msgInterval) { public String toString(int msgInterval) {
int numberOfRegions = this.regionLoad.size(); int numberOfRegions = this.regionLoad.size();
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb = Strings.appendKeyValue(sb, "requests", sb = Strings.appendKeyValue(sb, "requestsPerSecond",
Integer.valueOf(numberOfRequests/msgInterval)); Integer.valueOf(numberOfRequests/msgInterval));
sb = Strings.appendKeyValue(sb, "regions", sb = Strings.appendKeyValue(sb, "numberOfOnlineRegions",
Integer.valueOf(numberOfRegions)); Integer.valueOf(numberOfRegions));
sb = Strings.appendKeyValue(sb, "usedHeap", sb = Strings.appendKeyValue(sb, "usedHeapMB",
Integer.valueOf(this.usedHeapMB)); Integer.valueOf(this.usedHeapMB));
sb = Strings.appendKeyValue(sb, "maxHeap", Integer.valueOf(maxHeapMB)); sb = Strings.appendKeyValue(sb, "maxHeapMB", Integer.valueOf(maxHeapMB));
return sb.toString(); return sb.toString();
} }

View File

@ -594,11 +594,11 @@ public class LruBlockCache implements BlockCache, HeapSize {
"accesses=" + stats.getRequestCount() + ", " + "accesses=" + stats.getRequestCount() + ", " +
"hits=" + stats.getHitCount() + ", " + "hits=" + stats.getHitCount() + ", " +
"hitRatio=" + "hitRatio=" +
(stats.getHitCount() == 0 ? "0" : (StringUtils.formatPercent(stats.getHitRatio(), 2) + "%, ")) + (stats.getHitCount() == 0 ? "0" : (StringUtils.formatPercent(stats.getHitRatio(), 2)+ ", ")) +
"cachingAccesses=" + stats.getRequestCachingCount() + ", " + "cachingAccesses=" + stats.getRequestCachingCount() + ", " +
"cachingHits=" + stats.getHitCachingCount() + ", " + "cachingHits=" + stats.getHitCachingCount() + ", " +
"cachingHitsRatio=" + "cachingHitsRatio=" +
(stats.getHitCachingCount() == 0 ? "0" : (StringUtils.formatPercent(stats.getHitCachingRatio(), 2) + "%, ")) + (stats.getHitCachingCount() == 0 ? "0" : (StringUtils.formatPercent(stats.getHitCachingRatio(), 2)+ ", ")) +
"evictions=" + stats.getEvictionCount() + ", " + "evictions=" + stats.getEvictionCount() + ", " +
"evicted=" + stats.getEvictedCount() + ", " + "evicted=" + stats.getEvictedCount() + ", " +
"evictedPerRun=" + stats.evictedPerEviction()); "evictedPerRun=" + stats.evictedPerEviction());

View File

@ -38,6 +38,7 @@ import org.apache.hadoop.metrics.util.MetricsIntValue;
import org.apache.hadoop.metrics.util.MetricsLongValue; import org.apache.hadoop.metrics.util.MetricsLongValue;
import org.apache.hadoop.metrics.util.MetricsRegistry; import org.apache.hadoop.metrics.util.MetricsRegistry;
import org.apache.hadoop.metrics.util.MetricsTimeVaryingRate; import org.apache.hadoop.metrics.util.MetricsTimeVaryingRate;
import org.apache.hadoop.util.StringUtils;
import java.io.IOException; import java.io.IOException;
import java.lang.management.ManagementFactory; import java.lang.management.ManagementFactory;
@ -356,19 +357,15 @@ public class RegionServerMetrics implements Updater {
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
int seconds = (int)((System.currentTimeMillis() - this.lastUpdate)/1000); sb = Strings.appendKeyValue(sb, "requestsPerSecond",
if (seconds == 0) {
seconds = 1;
}
sb = Strings.appendKeyValue(sb, "request",
Float.valueOf(this.requests.getPreviousIntervalValue())); Float.valueOf(this.requests.getPreviousIntervalValue()));
sb = Strings.appendKeyValue(sb, "regions", sb = Strings.appendKeyValue(sb, "numberOfOnlineRegions",
Integer.valueOf(this.regions.get())); Integer.valueOf(this.regions.get()));
sb = Strings.appendKeyValue(sb, "stores", sb = Strings.appendKeyValue(sb, "numberOfStores",
Integer.valueOf(this.stores.get())); Integer.valueOf(this.stores.get()));
sb = Strings.appendKeyValue(sb, "storefiles", sb = Strings.appendKeyValue(sb, "numberOfStorefiles",
Integer.valueOf(this.storefiles.get())); Integer.valueOf(this.storefiles.get()));
sb = Strings.appendKeyValue(sb, "storefileIndexSize", sb = Strings.appendKeyValue(sb, this.storefileIndexSizeMB.getName(),
Integer.valueOf(this.storefileIndexSizeMB.get())); Integer.valueOf(this.storefileIndexSizeMB.get()));
sb = Strings.appendKeyValue(sb, "rootIndexSizeKB", sb = Strings.appendKeyValue(sb, "rootIndexSizeKB",
Integer.valueOf(this.rootIndexSizeKB.get())); Integer.valueOf(this.rootIndexSizeKB.get()));
@ -376,7 +373,7 @@ public class RegionServerMetrics implements Updater {
Integer.valueOf(this.totalStaticIndexSizeKB.get())); Integer.valueOf(this.totalStaticIndexSizeKB.get()));
sb = Strings.appendKeyValue(sb, "totalStaticBloomSizeKB", sb = Strings.appendKeyValue(sb, "totalStaticBloomSizeKB",
Integer.valueOf(this.totalStaticBloomSizeKB.get())); Integer.valueOf(this.totalStaticBloomSizeKB.get()));
sb = Strings.appendKeyValue(sb, "memstoreSize", sb = Strings.appendKeyValue(sb, this.memstoreSizeMB.getName(),
Integer.valueOf(this.memstoreSizeMB.get())); Integer.valueOf(this.memstoreSizeMB.get()));
sb = Strings.appendKeyValue(sb, "readRequestsCount", sb = Strings.appendKeyValue(sb, "readRequestsCount",
Long.valueOf(this.readRequestsCount.get())); Long.valueOf(this.readRequestsCount.get()));
@ -390,14 +387,14 @@ public class RegionServerMetrics implements Updater {
// inaccessible. // inaccessible.
MemoryUsage memory = MemoryUsage memory =
ManagementFactory.getMemoryMXBean().getHeapMemoryUsage(); ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
sb = Strings.appendKeyValue(sb, "usedHeap", sb = Strings.appendKeyValue(sb, "usedHeapMB",
Long.valueOf(memory.getUsed()/MB)); Long.valueOf(memory.getUsed()/MB));
sb = Strings.appendKeyValue(sb, "maxHeap", sb = Strings.appendKeyValue(sb, "maxHeapMB",
Long.valueOf(memory.getMax()/MB)); Long.valueOf(memory.getMax()/MB));
sb = Strings.appendKeyValue(sb, this.blockCacheSize.getName(), sb = Strings.appendKeyValue(sb, this.blockCacheSize.getName()+"MB",
Long.valueOf(this.blockCacheSize.get())); StringUtils.limitDecimalTo2((float)this.blockCacheSize.get()/MB));
sb = Strings.appendKeyValue(sb, this.blockCacheFree.getName(), sb = Strings.appendKeyValue(sb, this.blockCacheFree.getName()+"MB",
Long.valueOf(this.blockCacheFree.get())); StringUtils.limitDecimalTo2((float)this.blockCacheFree.get()/MB));
sb = Strings.appendKeyValue(sb, this.blockCacheCount.getName(), sb = Strings.appendKeyValue(sb, this.blockCacheCount.getName(),
Long.valueOf(this.blockCacheCount.get())); Long.valueOf(this.blockCacheCount.get()));
sb = Strings.appendKeyValue(sb, this.blockCacheHitCount.getName(), sb = Strings.appendKeyValue(sb, this.blockCacheHitCount.getName(),
@ -407,9 +404,9 @@ public class RegionServerMetrics implements Updater {
sb = Strings.appendKeyValue(sb, this.blockCacheEvictedCount.getName(), sb = Strings.appendKeyValue(sb, this.blockCacheEvictedCount.getName(),
Long.valueOf(this.blockCacheEvictedCount.get())); Long.valueOf(this.blockCacheEvictedCount.get()));
sb = Strings.appendKeyValue(sb, this.blockCacheHitRatio.getName(), sb = Strings.appendKeyValue(sb, this.blockCacheHitRatio.getName(),
Long.valueOf(this.blockCacheHitRatio.get())); Long.valueOf(this.blockCacheHitRatio.get())+"%");
sb = Strings.appendKeyValue(sb, this.blockCacheHitCachingRatio.getName(), sb = Strings.appendKeyValue(sb, this.blockCacheHitCachingRatio.getName(),
Long.valueOf(this.blockCacheHitCachingRatio.get())); Long.valueOf(this.blockCacheHitCachingRatio.get())+"%");
return sb.toString(); return sb.toString();
} }
} }