public class FileBasedMetricsPublisher extends Object implements MetricsPublisher
| Constructor and Description |
|---|
FileBasedMetricsPublisher(com.amazonaws.services.cloudwatch.AmazonCloudWatch client,
String filePath,
String namespace,
int millisBetweenRun)
Constructor.
|
FileBasedMetricsPublisher(com.amazonaws.services.cloudwatch.AmazonCloudWatch client,
String filePath,
String namespace,
int millisBetweenRun,
int logsRetentionPeriodMillis)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
closePublisher()
Close the publishing channel.
|
void |
publish(Collection<com.amazonaws.services.cloudwatch.model.MetricDatum> metrics)
Publish a collection of metrics to CW.
|
public FileBasedMetricsPublisher(com.amazonaws.services.cloudwatch.AmazonCloudWatch client,
String filePath,
String namespace,
int millisBetweenRun)
client - - AWS CloudWatch clientfilePath - - path where to store filesnamespace - - namespace used for CW publishingmillisBetweenRun - - time interval in millis between 2 file readspublic FileBasedMetricsPublisher(com.amazonaws.services.cloudwatch.AmazonCloudWatch client,
String filePath,
String namespace,
int millisBetweenRun,
int logsRetentionPeriodMillis)
client - - AWS CloudWatch clientfilePath - - path where to store filesnamespace - - namespace used for CW publishingmillisBetweenRun - - time interval in millis between 2 file readslogsRetentionPeriodMillis - - time interval in millis while logs are stored on diskpublic void publish(Collection<com.amazonaws.services.cloudwatch.model.MetricDatum> metrics) throws IOException
publish in interface MetricsPublishermetrics - metrics collectionIOException - - if an IO exception occurspublic void closePublisher()
closePublisher in interface MetricsPublisherCopyright © 2018. All rights reserved.