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 |
set(String name,
Object value) |
void |
startStoredScope(String name) |
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 addRatio(String name, MetricsVariable<Integer> numerator, MetricsVariable<Integer> denominator)
Metrics
public void markMeter(String name)
Metrics
public Object get(String name) throws JMException
JMException
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 MetricsScope getStoredScope(String name) throws IllegalStateException
IllegalStateException
public void endStoredScope(String name)
Metrics
endStoredScope
in interface Metrics
public MetricsScope createScope(String name)
Metrics
createScope
in interface Metrics
public void endScope(MetricsScope scope)
Metrics
Copyright © 2021 The Apache Software Foundation. All rights reserved.