@InterfaceAudience.Public @InterfaceStability.Evolving public class CompositeContext extends AbstractMetricsContext
AbstractMetricsContext.MetricMap, AbstractMetricsContext.TagMapDEFAULT_PERIOD| Constructor and Description |
|---|
CompositeContext() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Stops monitoring and frees buffered data, returning this
object to its initial state.
|
protected void |
emitRecord(String contextName,
String recordName,
OutputRecord outRec)
Sends a record to the metrics system.
|
protected void |
flush()
Called each period after all records have been emitted, this method does nothing.
|
void |
init(String contextName,
ContextFactory factory)
Initializes the context.
|
boolean |
isMonitoring()
Return true if all subcontexts are monitoring.
|
MetricsRecord |
newRecord(String recordName)
Subclasses should override this if they subclass MetricsRecordImpl.
|
void |
registerUpdater(Updater updater)
Registers a callback to be called at time intervals determined by
the configuration.
|
void |
startMonitoring()
Starts or restarts monitoring, the emitting of metrics records.
|
void |
stopMonitoring()
Stops monitoring.
|
void |
unregisterUpdater(Updater updater)
Removes a callback, if it exists.
|
createRecord, getAllRecords, getAttribute, getAttributeTable, getContextFactory, getContextName, getPeriod, parseAndSetPeriod, remove, setPeriod, update@InterfaceAudience.Private public CompositeContext()
@InterfaceAudience.Private public void init(String contextName, ContextFactory factory)
AbstractMetricsContextinit in interface MetricsContextinit in class AbstractMetricsContextcontextName - The given name for this contextfactory - The creator of this context@InterfaceAudience.Private public MetricsRecord newRecord(String recordName)
AbstractMetricsContextnewRecord in class AbstractMetricsContextrecordName - the name of the record@InterfaceAudience.Private protected void emitRecord(String contextName, String recordName, OutputRecord outRec) throws IOException
AbstractMetricsContextemitRecord in class AbstractMetricsContextIOException@InterfaceAudience.Private protected void flush() throws IOException
AbstractMetricsContextflush in class AbstractMetricsContextIOException@InterfaceAudience.Private public void startMonitoring() throws IOException
AbstractMetricsContextstartMonitoring in interface MetricsContextstartMonitoring in class AbstractMetricsContextIOException@InterfaceAudience.Private public void stopMonitoring()
AbstractMetricsContextstopMonitoring in interface MetricsContextstopMonitoring in class AbstractMetricsContextAbstractMetricsContext.close()@InterfaceAudience.Private public boolean isMonitoring()
isMonitoring in interface MetricsContextisMonitoring in class AbstractMetricsContext@InterfaceAudience.Private public void close()
AbstractMetricsContextclose in interface MetricsContextclose in class AbstractMetricsContext@InterfaceAudience.Private public void registerUpdater(Updater updater)
AbstractMetricsContextregisterUpdater in interface MetricsContextregisterUpdater in class AbstractMetricsContextupdater - object to be run periodically; it should update
some metrics records@InterfaceAudience.Private public void unregisterUpdater(Updater updater)
AbstractMetricsContextunregisterUpdater in interface MetricsContextunregisterUpdater in class AbstractMetricsContextupdater - object to be removed from the callback listCopyright © 2013 Apache Software Foundation. All rights reserved.