Modifier and Type | Class and Description |
---|---|
class |
CodahaleMetrics.CodahaleMetricsScope |
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOGGER |
com.codahale.metrics.MetricRegistry |
metricRegistry |
Constructor and Description |
---|
CodahaleMetrics(org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
void |
addGauge(String name,
MetricsVariable variable)
Adds a metrics-gauge to track variable.
|
void |
addRatio(String name,
MetricsVariable<Integer> numerator,
MetricsVariable<Integer> denominator)
Add a ratio metric to track the correlation between two variables
|
void |
close()
Deinitializes the Metrics system.
|
MetricsScope |
createScope(String name)
Create scope with given name and returns it.
|
Long |
decrementCounter(String name)
Decrements a counter of the given name by 1.
|
Long |
decrementCounter(String name,
long decrement)
Decrements a counter of the given name by "decrement"
|
String |
dumpJson() |
void |
endScope(MetricsScope scope)
Close the given scope.
|
void |
endStoredScope(String name)
Closes the stored scope of a given name.
|
com.codahale.metrics.MetricRegistry |
getMetricRegistry() |
MetricsScope |
getStoredScope(String name) |
Long |
incrementCounter(String name)
Increments a counter of the given name by 1.
|
Long |
incrementCounter(String name,
long increment)
Increments a counter of the given name by "increment"
|
void |
markMeter(String name)
Mark an event occurrence for a meter.
|
void |
removeGauge(String name)
Removed the gauge added by addGauge.
|
void |
startStoredScope(String name) |
public static final org.slf4j.Logger LOGGER
public final com.codahale.metrics.MetricRegistry metricRegistry
public CodahaleMetrics(org.apache.hadoop.conf.Configuration conf)
public void close() throws Exception
Metrics
public void startStoredScope(String name)
startStoredScope
in interface Metrics
name
- starts a scope of a given name. Scopes is stored as thread-local variable.public void endStoredScope(String name)
Metrics
endStoredScope
in interface Metrics
public MetricsScope getStoredScope(String name) throws IllegalArgumentException
IllegalArgumentException
public MetricsScope createScope(String name)
Metrics
createScope
in interface Metrics
public void endScope(MetricsScope scope)
Metrics
public Long incrementCounter(String name)
Metrics
incrementCounter
in interface Metrics
public Long incrementCounter(String name, long increment)
Metrics
incrementCounter
in interface Metrics
public Long decrementCounter(String name)
Metrics
decrementCounter
in interface Metrics
public Long decrementCounter(String name, long decrement)
Metrics
decrementCounter
in interface Metrics
public void addGauge(String name, MetricsVariable variable)
Metrics
public void removeGauge(String name)
Metrics
removeGauge
in interface Metrics
name
- name of gaugepublic void addRatio(String name, MetricsVariable<Integer> numerator, MetricsVariable<Integer> denominator)
Metrics
public void markMeter(String name)
Metrics
public com.codahale.metrics.MetricRegistry getMetricRegistry()
Copyright © 2022 The Apache Software Foundation. All rights reserved.