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 |
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 |
set(String name,
Object value) |
void |
startStoredScope(String name) |
public Long incrementCounter(String name) throws IOException
Metrics
incrementCounter
in interface Metrics
IOException
public Long incrementCounter(String name, long increment) throws IOException
Metrics
incrementCounter
in interface Metrics
IOException
public Long decrementCounter(String name) throws IOException
Metrics
decrementCounter
in interface Metrics
IOException
public Long decrementCounter(String name, long decrement) throws IOException
Metrics
decrementCounter
in interface Metrics
IOException
public void addGauge(String name, MetricsVariable variable)
Metrics
public void set(String name, Object value) throws IOException
IOException
public Object get(String name) throws IOException
IOException
public void startStoredScope(String name) throws IOException
startStoredScope
in interface Metrics
name
- starts a scope of a given name. Scopes is stored as thread-local variable.IOException
public MetricsScope getStoredScope(String name) throws IOException
IOException
public void endStoredScope(String name) throws IOException
Metrics
endStoredScope
in interface Metrics
IOException
public MetricsScope createScope(String name) throws IOException
Metrics
createScope
in interface Metrics
IOException
public void endScope(MetricsScope scope) throws IOException
Metrics
endScope
in interface Metrics
IOException
Copyright © 2016 The Apache Software Foundation. All rights reserved.