@InterfaceAudience.Private public final class MetricsConnection extends Object implements StatisticTrackable
MetricRegistry
and JmxReporter
so
as to not conflict with other uses of Yammer Metrics within the client application. Calling
getMetricsConnection(Configuration, String, Supplier, Supplier)
implicitly creates and
"starts" instances of these classes; be sure to call deleteMetricsConnection(String)
to
terminate the thread pools they allocate. The metrics reporter will be shutdown
shutdown()
when all connections within this metrics instances are closed.Modifier and Type | Class and Description |
---|---|
static class |
MetricsConnection.CallStats
A container class for collecting details about the RPC call as it percolates.
|
protected static class |
MetricsConnection.CallTracker |
protected static class |
MetricsConnection.RegionStats |
protected static class |
MetricsConnection.RunnerStats |
Modifier and Type | Field and Description |
---|---|
static String |
CLIENT_SIDE_METRICS_ENABLED_KEY
Set this key to
true to enable metrics collection of client requests. |
static String |
CLIENT_SIDE_TABLE_METRICS_ENABLED_KEY
Set this key to
true to enable table metrics collection of client requests. |
static String |
METRICS_SCOPE_KEY
Set to specify a custom scope for the metrics published through
MetricsConnection . |
Modifier and Type | Method and Description |
---|---|
MetricsConnection.CallTracker |
getAppendTracker()
appendTracker metric
|
long |
getConnectionCount()
Return the connection count of the metrics within a scope
|
MetricsConnection.CallTracker |
getDeleteTracker()
deleteTracker metric
|
MetricsConnection.CallTracker |
getGetTracker()
getTracker metric
|
com.codahale.metrics.Counter |
getHedgedReadOps()
hedgedReadOps metric
|
com.codahale.metrics.Counter |
getHedgedReadWin()
hedgedReadWin metric
|
MetricsConnection.CallTracker |
getIncrementTracker()
incrementTracker metric
|
long |
getMetaCacheMisses() |
com.codahale.metrics.Counter |
getMetaCacheNumClearRegion()
metaCacheNumClearRegion metric
|
com.codahale.metrics.Counter |
getMetaCacheNumClearServer()
metaCacheNumClearServer metric
|
String |
getMetricScope()
scope of the metrics object
|
MetricsConnection.CallTracker |
getMultiTracker()
multiTracker metric
|
com.codahale.metrics.Histogram |
getNumActionsPerServerHist()
numActionsPerServerHist metric
|
MetricsConnection.CallTracker |
getPutTracker()
putTracker metric
|
ConcurrentMap<String,com.codahale.metrics.Counter> |
getRpcCounters()
rpcCounters metric
|
ConcurrentMap<String,com.codahale.metrics.Histogram> |
getRpcHistograms()
rpcHistograms metric
|
ConcurrentMap<String,com.codahale.metrics.Timer> |
getRpcTimers()
rpcTimers metric
|
MetricsConnection.RunnerStats |
getRunnerStats()
runnerStats metric
|
MetricsConnection.CallTracker |
getScanTracker()
scanTracker metric
|
ConcurrentHashMap<ServerName,ConcurrentMap<byte[],MetricsConnection.RegionStats>> |
getServerStats()
serverStats metric
|
com.codahale.metrics.Timer |
getUserRegionLockHeldTimer() |
com.codahale.metrics.Histogram |
getUserRegionLockQueue() |
com.codahale.metrics.Counter |
getUserRegionLockTimeout()
get
|
com.codahale.metrics.Timer |
getUserRegionLockWaitingTimer() |
void |
incrCacheDroppingExceptions(Object exception) |
void |
incrDelayRunnersAndUpdateDelayInterval(long interval)
Increment the number of delay runner counts and update delay interval of delay runner.
|
void |
incrementServerOverloadedBackoffTime(long time,
TimeUnit timeUnit) |
void |
incrHedgedReadOps()
Increment the number of hedged read that have occurred.
|
void |
incrHedgedReadWin()
Increment the number of hedged read returned faster than the original read.
|
void |
incrMetaCacheHit()
Increment the number of meta cache hits.
|
void |
incrMetaCacheMiss()
Increment the number of meta cache misses.
|
void |
incrMetaCacheNumClearRegion()
Increment the number of meta cache drops requested for individual region.
|
void |
incrMetaCacheNumClearRegion(int count)
Increment the number of meta cache drops requested for individual region.
|
void |
incrMetaCacheNumClearServer()
Increment the number of meta cache drops requested for entire RegionServer.
|
void |
incrNormalRunners()
Increment the number of normal runner counts.
|
void |
incrNsLookups() |
void |
incrNsLookupsFailed() |
void |
incrUserRegionLockTimeout()
incr
|
static MetricsConnection.CallStats |
newCallStats()
Produce an instance of
MetricsConnection.CallStats for clients to attach to RPCs. |
void |
updateRegionStats(ServerName serverName,
byte[] regionName,
RegionLoadStats stats)
Update stats per region.
|
void |
updateRpc(org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.MethodDescriptor method,
TableName tableName,
org.apache.hbase.thirdparty.com.google.protobuf.Message param,
MetricsConnection.CallStats stats,
Throwable e)
Report RPC context to metrics system.
|
void |
updateServerStats(ServerName serverName,
byte[] regionName,
Object r) |
void |
updateUserRegionLockHeld(long duration) |
void |
updateUserRegionLockQueue(int count) |
void |
updateUserRegionLockWaiting(long duration)
update
|
public static final String CLIENT_SIDE_METRICS_ENABLED_KEY
true
to enable metrics collection of client requests.public static final String CLIENT_SIDE_TABLE_METRICS_ENABLED_KEY
true
to enable table metrics collection of client requests.public static final String METRICS_SCOPE_KEY
MetricsConnection
. The
scope is added to JMX MBean objectName, and defaults to a combination of the Connection's
clusterId and hashCode. For example, a default value for a connection to cluster "foo" might be
"foo-7d9d0818", where "7d9d0818" is the hashCode of the underlying AsyncConnectionImpl. Users
may set this key to give a more contextual name for this scope. For example, one might want to
differentiate a read connection from a write connection by setting the scopes to "foo-read" and
"foo-write" respectively. Scope is the only thing that lends any uniqueness to the metrics.
Care should be taken to avoid using the same scope for multiple Connections, otherwise the
metrics may aggregate in unforeseen ways.public void updateServerStats(ServerName serverName, byte[] regionName, Object r)
public void updateRegionStats(ServerName serverName, byte[] regionName, RegionLoadStats stats)
StatisticTrackable
updateRegionStats
in interface StatisticTrackable
public String getMetricScope()
public ConcurrentHashMap<ServerName,ConcurrentMap<byte[],MetricsConnection.RegionStats>> getServerStats()
public MetricsConnection.RunnerStats getRunnerStats()
public com.codahale.metrics.Counter getMetaCacheNumClearServer()
public com.codahale.metrics.Counter getMetaCacheNumClearRegion()
public com.codahale.metrics.Counter getHedgedReadOps()
public com.codahale.metrics.Counter getHedgedReadWin()
public com.codahale.metrics.Histogram getNumActionsPerServerHist()
public ConcurrentMap<String,com.codahale.metrics.Counter> getRpcCounters()
public ConcurrentMap<String,com.codahale.metrics.Timer> getRpcTimers()
public ConcurrentMap<String,com.codahale.metrics.Histogram> getRpcHistograms()
public MetricsConnection.CallTracker getGetTracker()
public MetricsConnection.CallTracker getScanTracker()
public MetricsConnection.CallTracker getMultiTracker()
public MetricsConnection.CallTracker getAppendTracker()
public MetricsConnection.CallTracker getDeleteTracker()
public MetricsConnection.CallTracker getIncrementTracker()
public MetricsConnection.CallTracker getPutTracker()
public static MetricsConnection.CallStats newCallStats()
MetricsConnection.CallStats
for clients to attach to RPCs.public void incrMetaCacheHit()
public void incrMetaCacheMiss()
public long getMetaCacheMisses()
public void incrMetaCacheNumClearServer()
public void incrMetaCacheNumClearRegion()
public void incrMetaCacheNumClearRegion(int count)
public void incrHedgedReadOps()
public void incrHedgedReadWin()
public void incrNormalRunners()
public void incrDelayRunnersAndUpdateDelayInterval(long interval)
public void incrementServerOverloadedBackoffTime(long time, TimeUnit timeUnit)
public void incrUserRegionLockTimeout()
public com.codahale.metrics.Counter getUserRegionLockTimeout()
public com.codahale.metrics.Timer getUserRegionLockWaitingTimer()
public com.codahale.metrics.Timer getUserRegionLockHeldTimer()
public com.codahale.metrics.Histogram getUserRegionLockQueue()
public void updateUserRegionLockWaiting(long duration)
public void updateUserRegionLockHeld(long duration)
public void updateUserRegionLockQueue(int count)
public long getConnectionCount()
public void updateRpc(org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.MethodDescriptor method, TableName tableName, org.apache.hbase.thirdparty.com.google.protobuf.Message param, MetricsConnection.CallStats stats, Throwable e)
public void incrCacheDroppingExceptions(Object exception)
public void incrNsLookups()
public void incrNsLookupsFailed()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.