@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)
AbstractMetricsContext
init
in interface MetricsContext
init
in class AbstractMetricsContext
contextName
- 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 MetricsContext
startMonitoring
in class AbstractMetricsContext
IOException
@InterfaceAudience.Private public void stopMonitoring()
stopMonitoring
in interface MetricsContext
stopMonitoring
in class AbstractMetricsContext
AbstractMetricsContext.close()
@InterfaceAudience.Private public void emitRecord(String contextName, String recordName, OutputRecord outRec)
emitRecord
in class AbstractMetricsContext
@InterfaceAudience.Private public void flush()
flush
in class AbstractMetricsContext
Copyright © 2013 Apache Software Foundation. All rights reserved.