|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MetricsContext
The main interface to the metrics package.
Field Summary | |
---|---|
static int |
DEFAULT_PERIOD
Default period in seconds at which data is sent to the metrics system. |
Method Summary | |
---|---|
void |
close()
Stops monitoring and also frees any buffered data, returning this object to its initial state. |
MetricsRecord |
createRecord(String recordName)
Creates a new MetricsRecord instance with the given recordName . |
String |
getContextName()
Returns the context name. |
boolean |
isMonitoring()
Returns true if monitoring is currently in progress. |
void |
registerUpdater(Updater updater)
Registers a callback to be called at regular time intervals, as determined by the implementation-class specific configuration. |
void |
startMonitoring()
Starts or restarts monitoring, the emitting of metrics records as they are updated. |
void |
stopMonitoring()
Stops monitoring. |
void |
unregisterUpdater(Updater updater)
Removes a callback, if it exists. |
Field Detail |
---|
static final int DEFAULT_PERIOD
Method Detail |
---|
String getContextName()
void startMonitoring() throws IOException
IOException
void stopMonitoring()
startMonitoring()
again after calling
this.
close()
boolean isMonitoring()
void close()
MetricsRecord createRecord(String recordName)
recordName
.
Throws an exception if the metrics implementation is configured with a fixed
set of record names and recordName
is not in that set.
recordName
- the name of the record
MetricsException
- if recordName conflicts with configuration datavoid registerUpdater(Updater updater)
updater
- object to be run periodically; it should updated
some metrics records and then returnvoid unregisterUpdater(Updater updater)
updater
- object to be removed from the callback list
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |