public class CodahaleMetricsProvider extends java.lang.Object implements StatsProvider
StatsProvider
implemented based on Codahale metrics library.Modifier and Type | Field and Description |
---|---|
(package private) com.codahale.metrics.JmxReporter |
jmx |
(package private) static org.slf4j.Logger |
LOG |
(package private) com.codahale.metrics.MetricRegistry |
metrics |
(package private) java.util.List<com.codahale.metrics.ScheduledReporter> |
reporters |
Constructor and Description |
---|
CodahaleMetricsProvider() |
Modifier and Type | Method and Description |
---|---|
com.codahale.metrics.MetricRegistry |
getMetrics() |
StatsLogger |
getStatsLogger(java.lang.String name)
Return the stats logger to a given scope.
|
java.lang.String |
getStatsName(java.lang.String... statsComponents)
Return the fully qualified stats name comprised of given statsComponents.
|
(package private) void |
initIfNecessary() |
void |
start(org.apache.commons.configuration.Configuration conf)
Intialize the stats provider by loading the given configuration conf.
|
void |
stop()
Close the stats provider.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
writeAllMetrics
static final org.slf4j.Logger LOG
com.codahale.metrics.MetricRegistry metrics
java.util.List<com.codahale.metrics.ScheduledReporter> reporters
com.codahale.metrics.JmxReporter jmx
void initIfNecessary()
public com.codahale.metrics.MetricRegistry getMetrics()
public void start(org.apache.commons.configuration.Configuration conf)
StatsProvider
start
in interface StatsProvider
conf
- Configuration to configure the stats provider.public void stop()
StatsProvider
stop
in interface StatsProvider
public StatsLogger getStatsLogger(java.lang.String name)
StatsProvider
getStatsLogger
in interface StatsProvider
name
- Scope for the given statspublic java.lang.String getStatsName(java.lang.String... statsComponents)
StatsProvider
getStatsName
in interface StatsProvider
statsComponents
- stats components to comprise the fully qualified stats nameCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.