Class GetMetricStatisticsTask
- java.lang.Object
-
- com.elastisys.autoscaler.metricstreamers.cloudwatch.tasks.GetMetricStatisticsTask
-
- All Implemented Interfaces:
java.util.concurrent.Callable<com.amazonaws.services.cloudwatch.model.GetMetricStatisticsResult>
public class GetMetricStatisticsTask extends java.lang.Object implements java.util.concurrent.Callable<com.amazonaws.services.cloudwatch.model.GetMetricStatisticsResult>ACallabletask that, when executed, requests statistics for a particular metric to be fetched from AWS CloudWatch in a given region. The returnedGetMetricStatisticsResponseobject stores the query metric in itslabelfield and will store the list ofDatapoints sorted in increasing order of time stamp (oldest first).
-
-
Constructor Summary
Constructors Constructor Description GetMetricStatisticsTask(java.lang.String awsAccessKeyId, java.lang.String awsSecretAccessKey, java.lang.String region, java.lang.String namespace, java.lang.String metric, java.util.List<CloudWatchStatistic> statistics, com.elastisys.scale.commons.json.types.TimeInterval period, java.util.Map<java.lang.String,java.lang.String> dimensions, org.joda.time.Interval queryInterval)Constructs a newGetMetricStatisticsTaskrequest.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.amazonaws.services.cloudwatch.model.GetMetricStatisticsResultcall()
-
-
-
Constructor Detail
-
GetMetricStatisticsTask
public GetMetricStatisticsTask(java.lang.String awsAccessKeyId, java.lang.String awsSecretAccessKey, java.lang.String region, java.lang.String namespace, java.lang.String metric, java.util.List<CloudWatchStatistic> statistics, com.elastisys.scale.commons.json.types.TimeInterval period, java.util.Map<java.lang.String,java.lang.String> dimensions, org.joda.time.Interval queryInterval)Constructs a newGetMetricStatisticsTaskrequest.- Parameters:
awsAccessKeyId- AWS access key id for the account to be used.awsSecretAccessKey- AWS secret access key for the account to be used.region- The AWS region that the request will be sent to.namespace- The Amazon CloudWatch namespace of the metric to fetch.metric- The CloudWatch metric that to retrieve data points for.period- The granularity of returned metric values (in seconds). Thestatisticsfunction will aggregate metric values with this level of granularity. Must be at least60seconds and must be a multiple of60.dimensions- The dimensions (key-value pairs) used to narrow down the result set. Only data points matching the specified dimensions will be returned.queryInterval- The time interval for the query. OnlyDatapoints whose time stamp lies within this interval will be returned. May benull.statistic- The aggregation method(s) to apply to metric values. Can be any of "Sum", "Average", "Minimum", "Maximum" and "SampleCount". The returnedDatapoints will contain one value for each specified statistic.
-
-