@InterfaceAudience.Public @InterfaceStability.Evolving @Deprecated public class FileContext extends AbstractMetricsContext
myContextName.fileName=/tmp/metrics.log myContextName.period=5
for metrics 2.0.AbstractMetricsContext.MetricMap, AbstractMetricsContext.TagMap| Modifier and Type | Field and Description |
|---|---|
protected static String |
FILE_NAME_PROPERTY
Deprecated.
|
protected static String |
PERIOD_PROPERTY
Deprecated.
|
DEFAULT_PERIOD| Constructor and Description |
|---|
FileContext()
Deprecated.
Creates a new instance of FileContext
|
| Modifier and Type | Method and Description |
|---|---|
void |
emitRecord(String contextName,
String recordName,
OutputRecord outRec)
Deprecated.
Emits a metrics record to a file.
|
void |
flush()
Deprecated.
Flushes the output writer, forcing updates to disk.
|
String |
getFileName()
Deprecated.
Returns the configured file name, or null.
|
void |
init(String contextName,
ContextFactory factory)
Deprecated.
Initializes the context.
|
void |
startMonitoring()
Deprecated.
Starts or restarts monitoring, by opening in append-mode, the
file specified by the
fileName attribute,
if specified. |
void |
stopMonitoring()
Deprecated.
Stops monitoring, closing the file.
|
close, createRecord, getAllRecords, getAttribute, getAttributeTable, getContextFactory, getContextName, getPeriod, isMonitoring, newRecord, parseAndSetPeriod, registerUpdater, remove, setPeriod, unregisterUpdater, update@InterfaceAudience.Private protected static final String FILE_NAME_PROPERTY
@InterfaceAudience.Private protected static final String PERIOD_PROPERTY
@InterfaceAudience.Private public FileContext()
@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 String getFileName()
@InterfaceAudience.Private public void startMonitoring() throws IOException
fileName attribute,
if specified. Otherwise the data will be written to standard
output.startMonitoring in interface MetricsContextstartMonitoring in class AbstractMetricsContextIOException@InterfaceAudience.Private public void stopMonitoring()
stopMonitoring in interface MetricsContextstopMonitoring in class AbstractMetricsContextAbstractMetricsContext.close()@InterfaceAudience.Private public void emitRecord(String contextName, String recordName, OutputRecord outRec)
emitRecord in class AbstractMetricsContext@InterfaceAudience.Private public void flush()
flush in class AbstractMetricsContextCopyright © 2013 Apache Software Foundation. All rights reserved.