HBASE-3509. Add metric for flush queue length

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1068189 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Todd Lipcon 2011-02-07 22:26:52 +00:00
parent 81022285b9
commit c479f0a984
4 changed files with 16 additions and 0 deletions

View File

@ -103,6 +103,7 @@ Release 0.90.1 - Unreleased
HBASE-3508 LruBlockCache statistics thread should have a name
HBASE-3511 Allow rolling restart to apply to only RS or only masters
HBASE-3510 Add thread name for IPC reader threads
HBASE-3509 Add metric for flush queue length
Release 0.90.0 - January 19th, 2011
INCOMPATIBLE CHANGES

View File

@ -1177,6 +1177,8 @@ public class HRegionServer implements HRegionInterface, HBaseRPCErrorHandler,
.set((int) (storefileIndexSize / (1024 * 1024)));
this.metrics.compactionQueueSize.set(compactSplitThread
.getCompactionQueueSize());
this.metrics.flushQueueSize.set(cacheFlusher
.getFlushQueueSize());
LruBlockCache lruBlockCache = (LruBlockCache) StoreFile.getBlockCache(conf);
if (lruBlockCache != null) {

View File

@ -263,6 +263,10 @@ class MemStoreFlusher extends Thread implements FlushRequester {
}
}
public int getFlushQueueSize() {
return flushQueue.size();
}
/**
* Only interrupt once it's done with a run through the work loop.
*/

View File

@ -144,6 +144,12 @@ public class RegionServerMetrics implements Updater {
*/
public final MetricsIntValue compactionQueueSize =
new MetricsIntValue("compactionQueueSize", registry);
/**
* Size of the flush queue.
*/
public final MetricsIntValue flushQueueSize =
new MetricsIntValue("flushQueueSize", registry);
/**
* filesystem read latency
@ -240,6 +246,7 @@ public class RegionServerMetrics implements Updater {
this.regions.pushMetric(this.metricsRecord);
this.requests.pushMetric(this.metricsRecord);
this.compactionQueueSize.pushMetric(this.metricsRecord);
this.flushQueueSize.pushMetric(this.metricsRecord);
this.blockCacheSize.pushMetric(this.metricsRecord);
this.blockCacheFree.pushMetric(this.metricsRecord);
this.blockCacheCount.pushMetric(this.metricsRecord);
@ -340,6 +347,8 @@ public class RegionServerMetrics implements Updater {
Integer.valueOf(this.memstoreSizeMB.get()));
sb = Strings.appendKeyValue(sb, "compactionQueueSize",
Integer.valueOf(this.compactionQueueSize.get()));
sb = Strings.appendKeyValue(sb, "flushQueueSize",
Integer.valueOf(this.flushQueueSize.get()));
// Duplicate from jvmmetrics because metrics are private there so
// inaccessible.
MemoryUsage memory =