com.amazonaws.util
Class AWSRequestMetrics
java.lang.Object
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. |
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)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
timingInfo
protected final TimingInfo timingInfo
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)
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.