Class PredefinedMetricTransformer
- java.lang.Object
-
- com.amazonaws.metrics.internal.cloudwatch.PredefinedMetricTransformer
-
public class PredefinedMetricTransformer extends Object
Used to transform the predefined metrics of the AWS SDK into instances ofMetricDatum
. See http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/ publishingMetrics.html- See Also:
AWSRequestMetrics
,RequestMetricCollector
-
-
Constructor Summary
Constructors Constructor Description PredefinedMetricTransformer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<MetricDatum>
counterMetricOf(MetricType type, Request<?> req, Object resp, boolean includesRequestType)
Returns a list of metric datum recorded for the specified counter metric type; or an empty list if there is none.protected List<MetricDatum>
latencyMetricOf(MetricType metricType, Request<?> req, Object response, boolean includesRequestType)
Returns all the latency metric data recorded for the specified metric event type; or an empty list if there is none.protected List<MetricDatum>
latencyOfClientExecuteTime(Request<?> req, Object response)
Returns a request type specific metrics forAWSRequestMetrics.Field.ClientExecuteTime
which is special in the sense that it makes a more accurate measurement by taking theTimingInfo
at the root into account.protected List<MetricDatum>
metricOfCount(AWSRequestMetrics.Field metricType, Request<?> req, Object resp)
protected List<MetricDatum>
metricOfRequestOrRetryCount(AWSRequestMetrics.Field metricType, Request<?> req, Object resp)
Returns a list with a single metric datum for the specified retry or request count predefined metric; or an empty list if there is none.List<MetricDatum>
toMetricData(MetricType metricType, Request<?> request, Response<?> response)
Returns a non-null list of metric datum for the metrics collected for the given request/response.
-
-
-
Method Detail
-
toMetricData
public List<MetricDatum> toMetricData(MetricType metricType, Request<?> request, Response<?> response)
Returns a non-null list of metric datum for the metrics collected for the given request/response.- Parameters:
metricType
- the request metric type
-
metricOfRequestOrRetryCount
protected List<MetricDatum> metricOfRequestOrRetryCount(AWSRequestMetrics.Field metricType, Request<?> req, Object resp)
Returns a list with a single metric datum for the specified retry or request count predefined metric; or an empty list if there is none.- Parameters:
metricType
- must be eitherAWSRequestMetrics.Field.RequestCount
orAWSRequestMetrics.Field.RetryCount
; or else GIGO.
-
metricOfCount
protected List<MetricDatum> metricOfCount(AWSRequestMetrics.Field metricType, Request<?> req, Object resp)
-
latencyMetricOf
protected List<MetricDatum> latencyMetricOf(MetricType metricType, Request<?> req, Object response, boolean includesRequestType)
Returns all the latency metric data recorded for the specified metric event type; or an empty list if there is none. The number of metric datum in the returned list should be exactly one when there is no retries, or more than one when there are retries.- Parameters:
includesRequestType
- true iff the "request" dimension is to be included;
-
latencyOfClientExecuteTime
protected List<MetricDatum> latencyOfClientExecuteTime(Request<?> req, Object response)
Returns a request type specific metrics forAWSRequestMetrics.Field.ClientExecuteTime
which is special in the sense that it makes a more accurate measurement by taking theTimingInfo
at the root into account.
-
counterMetricOf
protected List<MetricDatum> counterMetricOf(MetricType type, Request<?> req, Object resp, boolean includesRequestType)
Returns a list of metric datum recorded for the specified counter metric type; or an empty list if there is none.- Parameters:
includesRequestType
- true iff an additional metric datum is to be created that includes the "request" dimension
-
-