com.amazonaws.util
Class AWSRequestMetrics

java.lang.Object
  extended by com.amazonaws.util.AWSRequestMetrics
Direct Known Subclasses:
AWSRequestMetricsFullSupport

public class AWSRequestMetrics
extends java.lang.Object

Used as both a base class and a minimal support of AWS SDK request metrics. The base class of supporting AWS SDK request metrics.

In contrast to AWSRequestMetricsFullSupport, which is intended to be a full support of AWS SDK request metrics, this class only provides access to a TimingInfo instance that only has minimal support for start and end time (ie with no-ops for sub-event measurements) for backward compatibility reason. The other methods related to properties and counters in this class are effectively no-ops.

This class is instantiated instead of AWSRequestMetricsFullSupport when request metric collection is not required during a particular service request/response cycle.


Nested Class Summary
static class AWSRequestMetrics.Field
          Predefined AWS SDK metric types general across all AWS clients.
 
Constructor Summary
AWSRequestMetrics()
          This constructor should be used only in the case when AWS SDK metrics collector is disabled, when minimal timing info is supported for backward compatibility reasons.
 
Method Summary
 void addProperty(com.amazonaws.metrics.MetricType f, java.lang.Object value)
           
 void addProperty(java.lang.String propertyName, java.lang.Object value)
           
 void endEvent(com.amazonaws.metrics.MetricType f)
           
 void endEvent(java.lang.String eventName)
           
 java.util.List<java.lang.Object> getProperty(com.amazonaws.metrics.MetricType f)
           
 java.util.List<java.lang.Object> getProperty(java.lang.String propertyName)
           
 TimingInfo getTimingInfo()
           
 void incrementCounter(com.amazonaws.metrics.MetricType f)
           
 void incrementCounter(java.lang.String event)
           
 boolean isEnabled()
          Returns true if this metrics is enabled; false otherwise.
 void log()
           
 void setCounter(com.amazonaws.metrics.MetricType f, long count)
           
 void setCounter(java.lang.String counterName, long count)
           
 void startEvent(com.amazonaws.metrics.MetricType f)
           
 void startEvent(java.lang.String eventName)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AWSRequestMetrics

public AWSRequestMetrics()
This constructor should be used only in the case when AWS SDK metrics collector is disabled, when minimal timing info is supported for backward compatibility reasons.

See Also:
AWSRequestMetricsFullSupport
Method Detail

getTimingInfo

public final TimingInfo getTimingInfo()

isEnabled

public boolean isEnabled()
Returns true if this metrics is enabled; false otherwise. Returns false by default.


startEvent

public void startEvent(java.lang.String eventName)

startEvent

public void startEvent(com.amazonaws.metrics.MetricType f)

endEvent

public void endEvent(java.lang.String eventName)

endEvent

public void endEvent(com.amazonaws.metrics.MetricType f)

incrementCounter

public void incrementCounter(java.lang.String event)

incrementCounter

public void incrementCounter(com.amazonaws.metrics.MetricType f)

setCounter

public void setCounter(java.lang.String counterName,
                       long count)

setCounter

public void setCounter(com.amazonaws.metrics.MetricType f,
                       long count)

addProperty

public void addProperty(java.lang.String propertyName,
                        java.lang.Object value)

addProperty

public void addProperty(com.amazonaws.metrics.MetricType f,
                        java.lang.Object value)

log

public void log()

getProperty

public java.util.List<java.lang.Object> getProperty(java.lang.String propertyName)

getProperty

public java.util.List<java.lang.Object> getProperty(com.amazonaws.metrics.MetricType f)


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