com.amazonaws.util
Class AWSRequestMetrics

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

@NotThreadSafe
public class AWSRequestMetrics
extends 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.
 
Field Summary
protected  TimingInfo timingInfo
           
 
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.
protected AWSRequestMetrics(TimingInfo timingInfo)
           
 
Method Summary
 void addProperty(MetricType f, Object value)
           
 void addProperty(String propertyName, Object value)
           
 void endEvent(MetricType f)
           
 void endEvent(String eventName)
           
 List<Object> getProperty(MetricType f)
           
 List<Object> getProperty(String propertyName)
           
 TimingInfo getTimingInfo()
           
 void incrementCounter(MetricType f)
           
 void incrementCounter(String event)
           
 boolean isEnabled()
          Returns true if this metrics is enabled; false otherwise.
 void log()
           
 void setCounter(MetricType f, long count)
           
 void setCounter(String counterName, long count)
           
 void startEvent(MetricType f)
           
 void startEvent(String eventName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timingInfo

protected final TimingInfo timingInfo
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

AWSRequestMetrics

protected AWSRequestMetrics(TimingInfo timingInfo)
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(String eventName)

startEvent

public void startEvent(MetricType f)

endEvent

public void endEvent(String eventName)

endEvent

public void endEvent(MetricType f)

incrementCounter

public void incrementCounter(String event)

incrementCounter

public void incrementCounter(MetricType f)

setCounter

public void setCounter(String counterName,
                       long count)

setCounter

public void setCounter(MetricType f,
                       long count)

addProperty

public void addProperty(String propertyName,
                        Object value)

addProperty

public void addProperty(MetricType f,
                        Object value)

log

public void log()

getProperty

public List<Object> getProperty(String propertyName)

getProperty

public List<Object> getProperty(MetricType f)


Copyright © 2016. All rights reserved.