public class FileMetricsPublisher extends Object implements MetricsUpdater
FileMetric
class. A common file metric is the number of open
file-descriptors being used by the JVM.
NOTE: If you are using the no-arg constructor (like with Spring) you will need to make sure that
initialize()
is called.
Constructor and Description |
---|
FileMetricsPublisher() |
FileMetricsPublisher(MetricsManager metricsManager,
List<FileMetric> fileMetrics)
Constructs our publisher and calls
initialize() . |
Modifier and Type | Method and Description |
---|---|
long |
getFailedUpdateCount()
Number of times we were unable to update a metric because of some i/o or parse problem.
|
String[] |
getMetricsValues()
Get the values for all of the metric managed by this class.
|
void |
initialize()
Should be called if the no-arg construct is being used and after the various setters have been called.
|
void |
setFileMetrics(FileMetric[] fileMetrics)
Sets the file metrics that we are publishing.
|
void |
setMetricsManager(MetricsManager metricsManager)
Metrics manager that we add our metrics to.
|
void |
updateMetrics()
Called by
MetricsManager right before it is to persist the metrics. |
public FileMetricsPublisher()
public FileMetricsPublisher(MetricsManager metricsManager, List<FileMetric> fileMetrics)
initialize()
.public void initialize()
public void setMetricsManager(MetricsManager metricsManager)
public void setFileMetrics(FileMetric[] fileMetrics)
public void updateMetrics()
MetricsUpdater
MetricsManager
right before it is to persist the metrics.updateMetrics
in interface MetricsUpdater
public long getFailedUpdateCount()
public String[] getMetricsValues()
This content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.