public class TextFileMetricsPersister extends Object implements MetricValuesPersister
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_SEPARATING_STRING
Default string that separates a metric from its value.
|
Constructor and Description |
---|
TextFileMetricsPersister() |
Modifier and Type | Method and Description |
---|---|
void |
cleanMetricFilesOlderThanMillis(long millisOld)
Delete the old metrics files that have not been modified in a certain number of milliseconds.
|
long |
getCleanupLogCount()
Number of times we have cleaned up old logs.
|
long |
getDumpLogCount()
Number of times the logs have been dumped to disk.
|
String |
getLastDumpTimeMillisString()
Get the last time we have dumped the metrics to disk.
|
String |
getLogFileNamePrefix()
Get the log file name prefix that we are writing.
|
File |
getOutputDirectory()
Directory where the output files will be written.
|
boolean |
isAppendSysTimeMillis()
Are we appending the system time millis value to the name of the output file.
|
boolean |
isShowDescription()
Are we showing the description in the file on the previous line with a "# " prefix.
|
void |
persist(Map<ControlledMetric<?,?>,Number> metricValues,
long timeMillis)
Dump a log file with all of the metrics into a log file.
|
void |
setAppendSysTimeMillis(boolean appendSysTimeMillis)
Set to true to append the system time millis value to the name of the output file.
|
void |
setLogFileNamePrefix(String logFileNamePrefix)
Set the log file name prefix.
|
void |
setOutputDirectory(File outputDirectory)
Set the directory where the output files will be written.
|
void |
setSeparatingString(String separatingString)
Set the separating string between the metric name and value.
|
void |
setShowDescription(boolean showDescription)
Set to true to show the description in the file on the previous line with a "# " prefix.
|
public static final String DEFAULT_SEPARATING_STRING
public void persist(Map<ControlledMetric<?,?>,Number> metricValues, long timeMillis) throws IOException
persist
in interface MetricValuesPersister
metricValues
- The collection of metric and metric-values we are persisting.timeMillis
- The time in millis when the metrics were collected.IOException
- If there was an i/o error while persisting.public void cleanMetricFilesOlderThanMillis(long millisOld)
public String getLogFileNamePrefix()
public void setLogFileNamePrefix(String logFileNamePrefix)
public boolean isAppendSysTimeMillis()
public void setAppendSysTimeMillis(boolean appendSysTimeMillis)
public File getOutputDirectory()
public void setOutputDirectory(File outputDirectory)
public void setSeparatingString(String separatingString)
public boolean isShowDescription()
public void setShowDescription(boolean showDescription)
public long getDumpLogCount()
public long getCleanupLogCount()
public String getLastDumpTimeMillisString()
This content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.