public class LegacyMetrics extends Object implements Metrics
| Modifier and Type | Class and Description |
|---|---|
static class |
LegacyMetrics.LegacyMetricsScope
MetricsScope : A class that encapsulates an idea of a metered scope.
|
| Constructor and Description |
|---|
LegacyMetrics(HiveConf 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()
Resets the static context state to initial.
|
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"
|
void |
endScope(MetricsScope scope)
Close the given scope.
|
void |
endStoredScope(String name)
Closes the stored scope of a given name.
|
Object |
get(String name) |
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 occurance for a meter.
|
void |
removeGauge(String name)
Removed the gauge added by addGauge.
|
void |
set(String name,
Object value) |
void |
startStoredScope(String name) |
public Long incrementCounter(String name)
MetricsincrementCounter in interface Metricspublic Long incrementCounter(String name, long increment)
MetricsincrementCounter in interface Metricspublic Long decrementCounter(String name)
MetricsdecrementCounter in interface Metricspublic Long decrementCounter(String name, long decrement)
MetricsdecrementCounter in interface Metricspublic void addGauge(String name, MetricsVariable variable)
Metricspublic void removeGauge(String name)
MetricsremoveGauge in interface Metricsname - name of gaugepublic void addRatio(String name, MetricsVariable<Integer> numerator, MetricsVariable<Integer> denominator)
Metricspublic void markMeter(String name)
Metricspublic Object get(String name) throws JMException
JMExceptionpublic void startStoredScope(String name)
startStoredScope in interface Metricsname - starts a scope of a given name. Scopes is stored as thread-local variable.public MetricsScope getStoredScope(String name) throws IllegalStateException
IllegalStateExceptionpublic void endStoredScope(String name)
MetricsendStoredScope in interface Metricspublic MetricsScope createScope(String name)
MetricscreateScope in interface Metricspublic void endScope(MetricsScope scope)
MetricsCopyright © 2019 The Apache Software Foundation. All Rights Reserved.