com.amazonaws.util
Class AWSRequestMetricsFullSupport

java.lang.Object
  extended by com.amazonaws.util.AWSRequestMetrics
      extended by com.amazonaws.util.AWSRequestMetricsFullSupport

@NotThreadSafe
public class AWSRequestMetricsFullSupport
extends AWSRequestMetrics

In contrast to AWSRequestMetrics, 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 AWSRequestMetrics when 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
 
Constructor Summary
AWSRequestMetricsFullSupport()
          This constructor should be used in the case when AWS SDK metrics collector is enabled.
 
Method Summary
 void addProperty(MetricType f, java.lang.Object value)
           
 void addProperty(java.lang.String propertyName, java.lang.Object value)
          Add a property.
 void endEvent(MetricType f)
           
 void endEvent(java.lang.String eventName)
          End an event which was previously started.
 java.util.List<java.lang.Object> getProperty(MetricType f)
           
 java.util.List<java.lang.Object> getProperty(java.lang.String propertyName)
           
 void incrementCounter(MetricType f)
           
 void incrementCounter(java.lang.String event)
          Add 1 to an existing count for a given event.
 boolean isEnabled()
          Always returns true.
 void log()
           
 void setCounter(MetricType f, long count)
           
 void setCounter(java.lang.String counterName, long count)
           
 void startEvent(MetricType f)
           
 void startEvent(java.lang.String eventName)
          Start an event which will be timed.
 
Methods inherited from class com.amazonaws.util.AWSRequestMetrics
getTimingInfo
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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(java.lang.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 a RequestMetricCollector is in use either at the request, web service client, or AWS SDK level.

Overrides:
startEvent in class AWSRequestMetrics
Parameters:
eventName - - The name of the event to start
See Also:
AwsSdkMetrics

startEvent

public void startEvent(MetricType f)
Overrides:
startEvent in class AWSRequestMetrics

endEvent

public void endEvent(java.lang.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:
endEvent in class AWSRequestMetrics
Parameters:
eventName - - The name of the event to start

endEvent

public void endEvent(MetricType f)
Overrides:
endEvent in class AWSRequestMetrics

incrementCounter

public void incrementCounter(java.lang.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 a RequestMetricCollector is in use either at the request, web service client, or AWS SDK level.

Overrides:
incrementCounter in class AWSRequestMetrics
Parameters:
event - - The name of the event to count

incrementCounter

public void incrementCounter(MetricType f)
Overrides:
incrementCounter in class AWSRequestMetrics

setCounter

public void setCounter(java.lang.String counterName,
                       long count)
Overrides:
setCounter in class AWSRequestMetrics

setCounter

public void setCounter(MetricType f,
                       long count)
Overrides:
setCounter in class AWSRequestMetrics

addProperty

public void addProperty(java.lang.String propertyName,
                        java.lang.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 a RequestMetricCollector is in use either at the request, web service client, or AWS SDK level.

Overrides:
addProperty in class AWSRequestMetrics
Parameters:
propertyName - The name of the property
value - The property value

addProperty

public void addProperty(MetricType f,
                        java.lang.Object value)
Overrides:
addProperty in class AWSRequestMetrics

log

public void log()
Overrides:
log in class AWSRequestMetrics

getProperty

public java.util.List<java.lang.Object> getProperty(java.lang.String propertyName)
Overrides:
getProperty in class AWSRequestMetrics

getProperty

public java.util.List<java.lang.Object> getProperty(MetricType f)
Overrides:
getProperty in class AWSRequestMetrics

isEnabled

public final boolean isEnabled()
Always returns true.

Overrides:
isEnabled in class AWSRequestMetrics


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.