org.apache.hadoop.hbase.regionserver.metrics
Class RegionServerMetrics

java.lang.Object
  extended by org.apache.hadoop.hbase.regionserver.metrics.RegionServerMetrics
All Implemented Interfaces:
org.apache.hadoop.metrics.Updater

public class RegionServerMetrics
extends Object
implements org.apache.hadoop.metrics.Updater

This class is for maintaining the various regionserver statistics and publishing them through the metrics interfaces.

This class has a number of metrics variables that are publicly accessible; these variables (objects) have methods to update their values.


Field Summary
 org.apache.hadoop.metrics.util.MetricsTimeVaryingRate atomicIncrementTime
           
 org.apache.hadoop.metrics.util.MetricsLongValue blockCacheCount
          Block cache item count.
 org.apache.hadoop.metrics.util.MetricsLongValue blockCacheEvictedCount
          Block cache evict count.
 org.apache.hadoop.metrics.util.MetricsLongValue blockCacheFree
          Block cache free size.
 org.apache.hadoop.metrics.util.MetricsIntValue blockCacheHitCachingRatio
          Block hit caching ratio.
 org.apache.hadoop.metrics.util.MetricsLongValue blockCacheHitCount
          Block cache hit count.
 org.apache.hadoop.metrics.util.MetricsIntValue blockCacheHitRatio
          Block hit ratio.
 org.apache.hadoop.metrics.util.MetricsLongValue blockCacheMissCount
          Block cache miss count.
 org.apache.hadoop.metrics.util.MetricsLongValue blockCacheSize
          Block cache size.
 org.apache.hadoop.metrics.util.MetricsIntValue compactionQueueSize
          Size of the compaction queue.
protected  PersistentMetricsTimeVaryingRate compactionSize
           
protected  PersistentMetricsTimeVaryingRate compactionTime
          time each scheduled compaction takes
 MetricsHistogram deleteLatencies
          a latency histogram on 'delete' requests
 org.apache.hadoop.metrics.util.MetricsIntValue flushQueueSize
          Size of the flush queue.
protected  PersistentMetricsTimeVaryingRate flushSize
           
protected  PersistentMetricsTimeVaryingRate flushTime
          time each scheduled flush takes
 org.apache.hadoop.metrics.util.MetricsTimeVaryingRate fsReadLatency
          filesystem read latency
 MetricsHistogram fsReadLatencyHistogram
          Metrics on the distribution of filesystem read latencies (improved version of fsReadLatency)
 org.apache.hadoop.metrics.util.MetricsTimeVaryingRate fsSyncLatency
          filesystem sync latency
 org.apache.hadoop.metrics.util.MetricsTimeVaryingRate fsWriteLatency
          filesystem write latency
 MetricsHistogram fsWriteLatencyHistogram
          Metrics on the distribution of filesystem write latencies (improved version of fsWriteLatency)
 MetricsHistogram getLatencies
          a latency histogram on 'get' requests
 org.apache.hadoop.metrics.util.MetricsIntValue hdfsBlocksLocalityIndex
          HDFS blocks locality index
 org.apache.hadoop.metrics.util.MetricsIntValue hlogFileCount
          HLog file count
 org.apache.hadoop.metrics.util.MetricsIntValue memstoreSizeMB
          Sum of all the memstore sizes in this regionserver in MB
 MetricsHistogram putLatencies
          a latency histogram on 'put' requests
 org.apache.hadoop.metrics.util.MetricsLongValue readRequestsCount
          Count of read requests
 ExactCounterMetric regionAccessCounter
          Metrics on the distribution of region operations (how many 'operations' on each region).
 org.apache.hadoop.metrics.util.MetricsIntValue regions
          Count of regions carried by this regionserver
 MetricsRate requests
           
 org.apache.hadoop.metrics.util.MetricsIntValue rootIndexSizeKB
          The total size of block index root levels in this regionserver in KB.
 org.apache.hadoop.metrics.util.MetricsIntValue storefileIndexSizeMB
           
 org.apache.hadoop.metrics.util.MetricsIntValue storefiles
          Count of storefiles open on the regionserver.
 org.apache.hadoop.metrics.util.MetricsIntValue stores
          Count of stores open on the regionserver.
 org.apache.hadoop.metrics.util.MetricsIntValue totalStaticBloomSizeKB
          Total size of all Bloom filters (not necessarily loaded in memory)
 org.apache.hadoop.metrics.util.MetricsIntValue totalStaticIndexSizeKB
          Total size of all block indexes (not necessarily loaded in memory)
 org.apache.hadoop.metrics.util.MetricsLongValue writeRequestsCount
          Count of write requests
 
Constructor Summary
RegionServerMetrics()
           
 
Method Summary
 void addCompaction(long time, long size)
           
 void addFlush(List<Pair<Long,Long>> flushes)
           
 void doUpdates(org.apache.hadoop.metrics.MetricsContext caller)
          Since this object is a registered updater, this method will be called periodically, e.g.
 float getRequests()
           
 void incrementRequests(int inc)
           
 void resetAllMinMax()
           
 void shutdown()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

atomicIncrementTime

public final org.apache.hadoop.metrics.util.MetricsTimeVaryingRate atomicIncrementTime

regions

public final org.apache.hadoop.metrics.util.MetricsIntValue regions
Count of regions carried by this regionserver


blockCacheSize

public final org.apache.hadoop.metrics.util.MetricsLongValue blockCacheSize
Block cache size.


blockCacheFree

public final org.apache.hadoop.metrics.util.MetricsLongValue blockCacheFree
Block cache free size.


blockCacheCount

public final org.apache.hadoop.metrics.util.MetricsLongValue blockCacheCount
Block cache item count.


blockCacheHitCount

public final org.apache.hadoop.metrics.util.MetricsLongValue blockCacheHitCount
Block cache hit count.


blockCacheMissCount

public final org.apache.hadoop.metrics.util.MetricsLongValue blockCacheMissCount
Block cache miss count.


blockCacheEvictedCount

public final org.apache.hadoop.metrics.util.MetricsLongValue blockCacheEvictedCount
Block cache evict count.


blockCacheHitRatio

public final org.apache.hadoop.metrics.util.MetricsIntValue blockCacheHitRatio
Block hit ratio.


blockCacheHitCachingRatio

public final org.apache.hadoop.metrics.util.MetricsIntValue blockCacheHitCachingRatio
Block hit caching ratio. This only includes the requests to the block cache where caching was turned on. See HBASE-2253.


getLatencies

public final MetricsHistogram getLatencies
a latency histogram on 'get' requests


deleteLatencies

public final MetricsHistogram deleteLatencies
a latency histogram on 'delete' requests


putLatencies

public final MetricsHistogram putLatencies
a latency histogram on 'put' requests


requests

public final MetricsRate requests

stores

public final org.apache.hadoop.metrics.util.MetricsIntValue stores
Count of stores open on the regionserver.


storefiles

public final org.apache.hadoop.metrics.util.MetricsIntValue storefiles
Count of storefiles open on the regionserver.


readRequestsCount

public final org.apache.hadoop.metrics.util.MetricsLongValue readRequestsCount
Count of read requests


writeRequestsCount

public final org.apache.hadoop.metrics.util.MetricsLongValue writeRequestsCount
Count of write requests


storefileIndexSizeMB

public final org.apache.hadoop.metrics.util.MetricsIntValue storefileIndexSizeMB

rootIndexSizeKB

public final org.apache.hadoop.metrics.util.MetricsIntValue rootIndexSizeKB
The total size of block index root levels in this regionserver in KB.


totalStaticIndexSizeKB

public final org.apache.hadoop.metrics.util.MetricsIntValue totalStaticIndexSizeKB
Total size of all block indexes (not necessarily loaded in memory)


totalStaticBloomSizeKB

public final org.apache.hadoop.metrics.util.MetricsIntValue totalStaticBloomSizeKB
Total size of all Bloom filters (not necessarily loaded in memory)


hdfsBlocksLocalityIndex

public final org.apache.hadoop.metrics.util.MetricsIntValue hdfsBlocksLocalityIndex
HDFS blocks locality index


memstoreSizeMB

public final org.apache.hadoop.metrics.util.MetricsIntValue memstoreSizeMB
Sum of all the memstore sizes in this regionserver in MB


compactionQueueSize

public final org.apache.hadoop.metrics.util.MetricsIntValue compactionQueueSize
Size of the compaction queue.


flushQueueSize

public final org.apache.hadoop.metrics.util.MetricsIntValue flushQueueSize
Size of the flush queue.


fsReadLatencyHistogram

public final MetricsHistogram fsReadLatencyHistogram
Metrics on the distribution of filesystem read latencies (improved version of fsReadLatency)


fsWriteLatencyHistogram

public final MetricsHistogram fsWriteLatencyHistogram
Metrics on the distribution of filesystem write latencies (improved version of fsWriteLatency)


regionAccessCounter

public final ExactCounterMetric regionAccessCounter
Metrics on the distribution of region operations (how many 'operations' on each region). I'm using an exact counter since each RegionServer is, at most, responsible for a few hundred regions. If that weren't the case, we'd have to use a lossy stream counter.


fsReadLatency

public final org.apache.hadoop.metrics.util.MetricsTimeVaryingRate fsReadLatency
filesystem read latency


fsWriteLatency

public final org.apache.hadoop.metrics.util.MetricsTimeVaryingRate fsWriteLatency
filesystem write latency


fsSyncLatency

public final org.apache.hadoop.metrics.util.MetricsTimeVaryingRate fsSyncLatency
filesystem sync latency


hlogFileCount

public final org.apache.hadoop.metrics.util.MetricsIntValue hlogFileCount
HLog file count


compactionTime

protected final PersistentMetricsTimeVaryingRate compactionTime
time each scheduled compaction takes


compactionSize

protected final PersistentMetricsTimeVaryingRate compactionSize

flushTime

protected final PersistentMetricsTimeVaryingRate flushTime
time each scheduled flush takes


flushSize

protected final PersistentMetricsTimeVaryingRate flushSize
Constructor Detail

RegionServerMetrics

public RegionServerMetrics()
Method Detail

shutdown

public void shutdown()

doUpdates

public void doUpdates(org.apache.hadoop.metrics.MetricsContext caller)
Since this object is a registered updater, this method will be called periodically, e.g. every 5 seconds.

Specified by:
doUpdates in interface org.apache.hadoop.metrics.Updater
Parameters:
caller - the metrics context that this responsible for calling us

resetAllMinMax

public void resetAllMinMax()

getRequests

public float getRequests()
Returns:
Count of requests.

addCompaction

public void addCompaction(long time,
                          long size)
Parameters:
time - time that compaction took
size - bytesize of storefiles in the compaction

addFlush

public void addFlush(List<Pair<Long,Long>> flushes)
Parameters:
flushes - history in

incrementRequests

public void incrementRequests(int inc)
Parameters:
inc - How much to add to requests.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.