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
immediately at call return. (Vlad Dogaru via todd)
HBASE-4169 FSUtils LeaseRecovery for non HDFS FileSystems (Lohit Vijayarenu)
HBASE-3807 Fix units in RS UI metrics (subramanian raghunathan)
TASKS
HBASE-3559 Move report of split to master OFF the heartbeat channel

View File

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

View File

@ -594,11 +594,11 @@ public class LruBlockCache implements BlockCache, HeapSize {
"accesses=" + stats.getRequestCount() + ", " +
"hits=" + stats.getHitCount() + ", " +
"hitRatio=" +
(stats.getHitCount() == 0 ? "0" : (StringUtils.formatPercent(stats.getHitRatio(), 2) + "%, ")) +
(stats.getHitCount() == 0 ? "0" : (StringUtils.formatPercent(stats.getHitRatio(), 2)+ ", ")) +
"cachingAccesses=" + stats.getRequestCachingCount() + ", " +
"cachingHits=" + stats.getHitCachingCount() + ", " +
"cachingHitsRatio=" +
(stats.getHitCachingCount() == 0 ? "0" : (StringUtils.formatPercent(stats.getHitCachingRatio(), 2) + "%, ")) +
(stats.getHitCachingCount() == 0 ? "0" : (StringUtils.formatPercent(stats.getHitCachingRatio(), 2)+ ", ")) +
"evictions=" + stats.getEvictionCount() + ", " +
"evicted=" + stats.getEvictedCount() + ", " +
"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.MetricsRegistry;
import org.apache.hadoop.metrics.util.MetricsTimeVaryingRate;
import org.apache.hadoop.util.StringUtils;
import java.io.IOException;
import java.lang.management.ManagementFactory;
@ -356,19 +357,15 @@ public class RegionServerMetrics implements Updater {
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
int seconds = (int)((System.currentTimeMillis() - this.lastUpdate)/1000);
if (seconds == 0) {
seconds = 1;
}
sb = Strings.appendKeyValue(sb, "request",
sb = Strings.appendKeyValue(sb, "requestsPerSecond",
Float.valueOf(this.requests.getPreviousIntervalValue()));
sb = Strings.appendKeyValue(sb, "regions",
sb = Strings.appendKeyValue(sb, "numberOfOnlineRegions",
Integer.valueOf(this.regions.get()));
sb = Strings.appendKeyValue(sb, "stores",
sb = Strings.appendKeyValue(sb, "numberOfStores",
Integer.valueOf(this.stores.get()));
sb = Strings.appendKeyValue(sb, "storefiles",
sb = Strings.appendKeyValue(sb, "numberOfStorefiles",
Integer.valueOf(this.storefiles.get()));
sb = Strings.appendKeyValue(sb, "storefileIndexSize",
sb = Strings.appendKeyValue(sb, this.storefileIndexSizeMB.getName(),
Integer.valueOf(this.storefileIndexSizeMB.get()));
sb = Strings.appendKeyValue(sb, "rootIndexSizeKB",
Integer.valueOf(this.rootIndexSizeKB.get()));
@ -376,7 +373,7 @@ public class RegionServerMetrics implements Updater {
Integer.valueOf(this.totalStaticIndexSizeKB.get()));
sb = Strings.appendKeyValue(sb, "totalStaticBloomSizeKB",
Integer.valueOf(this.totalStaticBloomSizeKB.get()));
sb = Strings.appendKeyValue(sb, "memstoreSize",
sb = Strings.appendKeyValue(sb, this.memstoreSizeMB.getName(),
Integer.valueOf(this.memstoreSizeMB.get()));
sb = Strings.appendKeyValue(sb, "readRequestsCount",
Long.valueOf(this.readRequestsCount.get()));
@ -390,14 +387,14 @@ public class RegionServerMetrics implements Updater {
// inaccessible.
MemoryUsage memory =
ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
sb = Strings.appendKeyValue(sb, "usedHeap",
sb = Strings.appendKeyValue(sb, "usedHeapMB",
Long.valueOf(memory.getUsed()/MB));
sb = Strings.appendKeyValue(sb, "maxHeap",
sb = Strings.appendKeyValue(sb, "maxHeapMB",
Long.valueOf(memory.getMax()/MB));
sb = Strings.appendKeyValue(sb, this.blockCacheSize.getName(),
Long.valueOf(this.blockCacheSize.get()));
sb = Strings.appendKeyValue(sb, this.blockCacheFree.getName(),
Long.valueOf(this.blockCacheFree.get()));
sb = Strings.appendKeyValue(sb, this.blockCacheSize.getName()+"MB",
StringUtils.limitDecimalTo2((float)this.blockCacheSize.get()/MB));
sb = Strings.appendKeyValue(sb, this.blockCacheFree.getName()+"MB",
StringUtils.limitDecimalTo2((float)this.blockCacheFree.get()/MB));
sb = Strings.appendKeyValue(sb, this.blockCacheCount.getName(),
Long.valueOf(this.blockCacheCount.get()));
sb = Strings.appendKeyValue(sb, this.blockCacheHitCount.getName(),
@ -407,9 +404,9 @@ public class RegionServerMetrics implements Updater {
sb = Strings.appendKeyValue(sb, this.blockCacheEvictedCount.getName(),
Long.valueOf(this.blockCacheEvictedCount.get()));
sb = Strings.appendKeyValue(sb, this.blockCacheHitRatio.getName(),
Long.valueOf(this.blockCacheHitRatio.get()));
Long.valueOf(this.blockCacheHitRatio.get())+"%");
sb = Strings.appendKeyValue(sb, this.blockCacheHitCachingRatio.getName(),
Long.valueOf(this.blockCacheHitCachingRatio.get()));
Long.valueOf(this.blockCacheHitCachingRatio.get())+"%");
return sb.toString();
}
}