public class FileMetric extends Object
Modifier and Type | Class and Description |
---|---|
static class |
FileMetric.ProcMetricKind
Kind of metrics that we are processing here.
|
Constructor and Description |
---|
FileMetric() |
FileMetric(String metricName,
String metricComponent,
String metricModule,
String description,
File metricFile,
FileMetric.ProcMetricKind kind,
int column,
String lineSplit,
String prefix) |
Modifier and Type | Method and Description |
---|---|
ControlledMetric<?,?> |
getMetric() |
void |
initialize()
Should be called after all of the setter methods are called, maybe my Spring init mechanism?
|
boolean |
isInitialized() |
void |
setColumn(int column)
The column from a split perspective (0 to N-1) or the matcher.group(column) if using the line-pattern regex.
|
void |
setDescription(String description)
The description to be associated with the metric.
|
void |
setKind(FileMetric.ProcMetricKind kind)
The kind of the metric.
|
void |
setLinePattern(String linePattern)
Set the regex pattern that should match the line.
|
void |
setLineSplit(String lineSplit)
Regex string to use to divide the line up into fields so we can use the column to extract one of the fields.
|
void |
setMetricComponent(String metricComponent)
The component to be associated with the metric.
|
void |
setMetricFile(String metricFile)
The file that we process to find the value.
|
void |
setMetricFiles(String[] metricFiles)
An array of files that that will be looked at.
|
void |
setMetricModule(String metricModule)
The module to be associated with the metric.
|
void |
setMetricName(String metricName)
The name to be associated with the metric.
|
void |
setPrefix(String prefix)
Prefix string to look for in the file.
|
void |
setRequired(boolean required)
Set whether or not this metric is required, default is false.
|
void |
setUnit(String unit)
The unit to be associated with the metric.
|
String |
toString() |
void |
updateValue()
Update the value in the metric.
|
public FileMetric()
public FileMetric(String metricName, String metricComponent, String metricModule, String description, File metricFile, FileMetric.ProcMetricKind kind, int column, String lineSplit, String prefix) throws IllegalArgumentException
IllegalArgumentException
public void initialize() throws IllegalArgumentException
IllegalArgumentException
public void updateValue() throws IOException
IOException
public ControlledMetric<?,?> getMetric()
public boolean isInitialized()
public void setMetricFile(String metricFile)
setMetricFiles(String[])
must be specified.public void setMetricFiles(String[] metricFiles)
setMetricFile(String)
must be specified.public void setMetricName(String metricName)
ControlledMetric.getName()
.public void setMetricComponent(String metricComponent)
ControlledMetric.getComponent()
.public void setMetricModule(String metricModule)
ControlledMetric.getModule()
.public void setDescription(String description)
ControlledMetric.getDescription()
.public void setUnit(String unit)
ControlledMetric.getUnit()
.public void setKind(FileMetric.ProcMetricKind kind)
FileMetric.ProcMetricKind
.public void setColumn(int column)
public void setLineSplit(String lineSplit)
public void setLinePattern(String linePattern)
public void setPrefix(String prefix)
public void setRequired(boolean required)
This content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.