Package com.amazonaws.util
Class AWSRequestMetricsFullSupport
- java.lang.Object
-
- com.amazonaws.util.AWSRequestMetrics
-
- com.amazonaws.util.AWSRequestMetricsFullSupport
-
public class AWSRequestMetricsFullSupport extends AWSRequestMetrics
In contrast toAWSRequestMetrics, which is intended to be a minimal support of AWS SDK request metrics, this class is the full support of AWS SDK request metrics including features such as properties and sub-events.This class is instantiated instead of
AWSRequestMetricswhen request metric collection is required during a particular service request/response cycle.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.amazonaws.util.AWSRequestMetrics
AWSRequestMetrics.Field
-
-
Field Summary
-
Fields inherited from class com.amazonaws.util.AWSRequestMetrics
timingInfo
-
-
Constructor Summary
Constructors Constructor Description AWSRequestMetricsFullSupport()This constructor should be used in the case when AWS SDK metrics collector is enabled.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProperty(MetricType f, Object value)voidaddProperty(String propertyName, Object value)Add a property.voidendEvent(MetricType f)voidendEvent(String eventName)End an event which was previously started.List<Object>getProperty(MetricType f)List<Object>getProperty(String propertyName)voidincrementCounter(MetricType f)voidincrementCounter(String event)Add 1 to an existing count for a given event.booleanisEnabled()Always returns true.voidlog()voidsetCounter(MetricType f, long count)voidsetCounter(String counterName, long count)voidstartEvent(MetricType f)voidstartEvent(String eventName)Start an event which will be timed.-
Methods inherited from class com.amazonaws.util.AWSRequestMetrics
addPropertyWith, addPropertyWith, getTimingInfo, incrementCounterWith, incrementCounterWith, withCounter, withCounter
-
-
-
-
Constructor Detail
-
AWSRequestMetricsFullSupport
public AWSRequestMetricsFullSupport()
This constructor should be used in the case when AWS SDK metrics collector is enabled.- See Also:
AWSRequestMetricsFullSupport
-
-
Method Detail
-
startEvent
public void startEvent(String eventName)
Start an event which will be timed. The startTime and endTime are added to timingInfo only after endEvent is called. For every startEvent there should be a corresponding endEvent. If you start the same event without ending it, this will overwrite the old event. i.e. There is no support for recursive events yet. Having said that, if you start and end an event in that sequence multiple times, all events are logged in timingInfo in that order. This feature is enabled if the system property "com.amazonaws.sdk.enableRuntimeProfiling" is set, or if aRequestMetricCollectoris in use either at the request, web service client, or AWS SDK level.- Overrides:
startEventin classAWSRequestMetrics- Parameters:
eventName- - The name of the event to start- See Also:
AwsSdkMetrics
-
startEvent
public void startEvent(MetricType f)
- Overrides:
startEventin classAWSRequestMetrics
-
endEvent
public void endEvent(String eventName)
End an event which was previously started. Once ended, log how much time the event took. It is illegal to end an Event that was not started. It is good practice to endEvent in a finally block. See Also startEvent.- Overrides:
endEventin classAWSRequestMetrics- Parameters:
eventName- - The name of the event to start
-
endEvent
public void endEvent(MetricType f)
- Overrides:
endEventin classAWSRequestMetrics
-
incrementCounter
public void incrementCounter(String event)
Add 1 to an existing count for a given event. If the count for that event does not exist, then it creates one and initializes it to 1. This feature is enabled if the system property "com.amazonaws.sdk.enableRuntimeProfiling" is set, or if aRequestMetricCollectoris in use either at the request, web service client, or AWS SDK level.- Overrides:
incrementCounterin classAWSRequestMetrics- Parameters:
event- - The name of the event to count
-
incrementCounter
public void incrementCounter(MetricType f)
- Overrides:
incrementCounterin classAWSRequestMetrics
-
setCounter
public void setCounter(String counterName, long count)
- Overrides:
setCounterin classAWSRequestMetrics
-
setCounter
public void setCounter(MetricType f, long count)
- Overrides:
setCounterin classAWSRequestMetrics
-
addProperty
public void addProperty(String propertyName, Object value)
Add a property. If you add the same property more than once, it stores all values a list. This feature is enabled if the system property "com.amazonaws.sdk.enableRuntimeProfiling" is set, or if aRequestMetricCollectoris in use either at the request, web service client, or AWS SDK level.- Overrides:
addPropertyin classAWSRequestMetrics- Parameters:
propertyName- The name of the propertyvalue- The property value
-
addProperty
public void addProperty(MetricType f, Object value)
- Overrides:
addPropertyin classAWSRequestMetrics
-
log
public void log()
- Overrides:
login classAWSRequestMetrics
-
getProperty
public List<Object> getProperty(String propertyName)
- Overrides:
getPropertyin classAWSRequestMetrics
-
getProperty
public List<Object> getProperty(MetricType f)
- Overrides:
getPropertyin classAWSRequestMetrics
-
isEnabled
public final boolean isEnabled()
Always returns true.- Overrides:
isEnabledin classAWSRequestMetrics
-
-