Package com.amazonaws.util
Class AWSRequestMetrics
java.lang.Object
com.amazonaws.util.AWSRequestMetrics
- Direct Known Subclasses:
AWSRequestMetricsFullSupport
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
Nested ClassesModifier and TypeClassDescriptionstatic enum
Predefined AWS SDK metric types general across all AWS clients. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionThis 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
Modifier and TypeMethodDescriptionvoid
addProperty
(MetricType f, Object value) void
addProperty
(String propertyName, Object value) final AWSRequestMetrics
addPropertyWith
(MetricType f, Object value) Fluent API ofaddProperty(MetricType, Object)
final AWSRequestMetrics
addPropertyWith
(String propertyName, Object value) Fluent API ofaddProperty(String, Object)
void
void
getProperty
(String propertyName) final TimingInfo
void
void
incrementCounter
(String event) final AWSRequestMetrics
Fluent API ofincrementCounter(MetricType)
final AWSRequestMetrics
incrementCounterWith
(String event) Fluent API ofincrementCounter(String)
boolean
Returns true if this metrics is enabled; false otherwise.void
log()
void
setCounter
(MetricType f, long count) void
setCounter
(String counterName, long count) void
void
startEvent
(String eventName) final AWSRequestMetrics
withCounter
(MetricType f, long count) Fluent API ofsetCounter(MetricType, long)
final AWSRequestMetrics
withCounter
(String counterName, long count) Fluent API ofsetCounter(String, long)
-
Field Details
-
timingInfo
-
-
Constructor Details
-
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:
-
AWSRequestMetrics
-
-
Method Details
-
getTimingInfo
-
isEnabled
public boolean isEnabled()Returns true if this metrics is enabled; false otherwise. Returns false by default. -
startEvent
-
startEvent
-
endEvent
-
endEvent
-
incrementCounter
-
incrementCounter
-
incrementCounterWith
Fluent API ofincrementCounter(String)
-
incrementCounterWith
Fluent API ofincrementCounter(MetricType)
-
setCounter
-
setCounter
-
withCounter
Fluent API ofsetCounter(String, long)
-
withCounter
Fluent API ofsetCounter(MetricType, long)
-
addProperty
-
addProperty
-
addPropertyWith
Fluent API ofaddProperty(String, Object)
-
addPropertyWith
Fluent API ofaddProperty(MetricType, Object)
-
log
public void log() -
getProperty
-
getProperty
-