|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.flume.instrumentation.MonitoredCounterGroup
public abstract class MonitoredCounterGroup
Used for keeping track of internal metrics using atomic integers
This is used by a variety of component types such as Sources, Channels, Sinks, SinkProcessors, ChannelProcessors, Interceptors and Serializers.
Nested Class Summary | |
---|---|
static class |
MonitoredCounterGroup.Type
Component Enum Constants Used by each component's constructor to distinguish which type the component is. |
Constructor Summary | |
---|---|
protected |
MonitoredCounterGroup(MonitoredCounterGroup.Type type,
String name,
String... attrs)
|
Method Summary | |
---|---|
protected long |
addAndGet(String counter,
long delta)
Atomically adds the delta to the current value for this key |
protected long |
get(String counter)
Retrieves the current value for this key |
long |
getStartTime()
Returns when this component was first started |
long |
getStopTime()
Returns when this component was stopped |
String |
getType()
|
protected long |
increment(String counter)
Atomically increments the current value for this key by one |
protected void |
set(String counter,
long value)
Sets the value for this key to the given value |
void |
start()
Starts the component Initializes the values for the stop time as well as all the keys in the internal map to zero and sets the start time to the current time in milliseconds since midnight January 1, 1970 UTC |
void |
stop()
Shuts Down the Component Used to indicate that the component is shutting down. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected MonitoredCounterGroup(MonitoredCounterGroup.Type type, String name, String... attrs)
Method Detail |
---|
public void start()
public void stop()
public long getStartTime()
public long getStopTime()
public final String toString()
toString
in class Object
protected long get(String counter)
counter
- The key for this metric
protected void set(String counter, long value)
counter
- The key for this metricvalue
- The new value for this keyprotected long addAndGet(String counter, long delta)
counter
- The key for this metricdelta
-
protected long increment(String counter)
counter
- The key for this metric
public String getType()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |