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 of MetricDatum. See http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/ publishingMetrics.html
See Also:
  • Constructor Details

    • PredefinedMetricTransformer

      public PredefinedMetricTransformer()
  • Method Details

    • 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 either AWSRequestMetrics.Field.RequestCount or AWSRequestMetrics.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 for AWSRequestMetrics.Field.ClientExecuteTime which is special in the sense that it makes a more accurate measurement by taking the TimingInfo 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