public class PredefinedMetricTransformer
extends java.lang.Object
MetricDatum
.
See http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/
publishingMetrics.htmlAWSRequestMetrics
,
RequestMetricCollector
Modifier and Type | Field and Description |
---|---|
(package private) static boolean |
EXCLUDE_REQUEST_TYPE |
(package private) static boolean |
INCLUDE_REQUEST_TYPE |
private static org.apache.commons.logging.Log |
log |
Constructor and Description |
---|
PredefinedMetricTransformer() |
Modifier and Type | Method and Description |
---|---|
protected java.util.List<MetricDatum> |
counterMetricOf(MetricType type,
Request<?> req,
java.lang.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 java.util.List<MetricDatum> |
latencyMetricOf(MetricType metricType,
Request<?> req,
java.lang.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 java.util.List<MetricDatum> |
latencyOfClientExecuteTime(Request<?> req,
java.lang.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. |
protected java.util.List<MetricDatum> |
metricOfCount(AWSRequestMetrics.Field metricType,
Request<?> req,
java.lang.Object resp) |
protected java.util.List<MetricDatum> |
metricOfRequestOrRetryCount(AWSRequestMetrics.Field metricType,
Request<?> req,
java.lang.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.
|
private java.lang.String |
requestType(Request<?> req)
Returns the name of the type of request.
|
java.util.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.
|
private static final org.apache.commons.logging.Log log
static final boolean INCLUDE_REQUEST_TYPE
static final boolean EXCLUDE_REQUEST_TYPE
public java.util.List<MetricDatum> toMetricData(MetricType metricType, Request<?> request, Response<?> response)
metricType
- the request metric typeprotected java.util.List<MetricDatum> metricOfRequestOrRetryCount(AWSRequestMetrics.Field metricType, Request<?> req, java.lang.Object resp)
metricType
- must be either AWSRequestMetrics.Field.RequestCount
or
AWSRequestMetrics.Field.RetryCount
; or else GIGO.protected java.util.List<MetricDatum> metricOfCount(AWSRequestMetrics.Field metricType, Request<?> req, java.lang.Object resp)
protected java.util.List<MetricDatum> latencyMetricOf(MetricType metricType, Request<?> req, java.lang.Object response, boolean includesRequestType)
includesRequestType
- true iff the "request" dimension is to be included;protected java.util.List<MetricDatum> latencyOfClientExecuteTime(Request<?> req, java.lang.Object response)
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.private java.lang.String requestType(Request<?> req)
protected java.util.List<MetricDatum> counterMetricOf(MetricType type, Request<?> req, java.lang.Object resp, boolean includesRequestType)
includesRequestType
- true iff an additional metric datum is to be created that
includes the "request" dimension