public abstract class MonitoredCounterGroup extends Object
Modifier and Type | Class and Description |
---|---|
static class |
MonitoredCounterGroup.Type
Component Enum Constants
Used by each component's constructor to distinguish which type the
component is.
|
Modifier | Constructor and Description |
---|---|
protected |
MonitoredCounterGroup(MonitoredCounterGroup.Type type,
String name,
String... attrs) |
Modifier and Type | Method and Description |
---|---|
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() |
protected MonitoredCounterGroup(MonitoredCounterGroup.Type type, String name, String... attrs)
public void start()
public void stop()
public long getStartTime()
public long getStopTime()
protected long get(String counter)
counter
- The key for this metricprotected 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 metricpublic String getType()
Copyright © 2009-2016 Apache Software Foundation. All Rights Reserved.