@NotThreadSafe public class AWSRequestMetrics extends Object
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.
Modifier and Type | Class and Description |
---|---|
static class |
AWSRequestMetrics.Field
Predefined AWS SDK metric types general across all AWS clients.
|
Modifier and Type | Field and Description |
---|---|
static String |
SIMPLE_NAME
If the class name is required for logging and metrics we should use this
constant version instead of the expensive function call.
|
protected TimingInfo |
timingInfo |
Modifier | Constructor and Description |
---|---|
|
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) |
public static final String SIMPLE_NAME
protected final TimingInfo timingInfo
public AWSRequestMetrics()
AWSRequestMetricsFullSupport
protected AWSRequestMetrics(TimingInfo timingInfo)
public final TimingInfo getTimingInfo()
public boolean isEnabled()
public void startEvent(String eventName)
public void startEvent(MetricType f)
public void endEvent(String eventName)
public void endEvent(MetricType f)
public void incrementCounter(String event)
public void incrementCounter(MetricType f)
public final AWSRequestMetrics incrementCounterWith(String event)
AWSRequestMetrics.incrementCounter(String)
public final AWSRequestMetrics incrementCounterWith(MetricType f)
AWSRequestMetrics.incrementCounter(MetricType)
public void setCounter(String counterName, long count)
public void setCounter(MetricType f, long count)
public final AWSRequestMetrics withCounter(String counterName, long count)
AWSRequestMetrics.setCounter(String, long)
public final AWSRequestMetrics withCounter(MetricType f, long count)
AWSRequestMetrics.setCounter(MetricType, long)
public void addProperty(MetricType f, Object value)
public final AWSRequestMetrics addPropertyWith(String propertyName, Object value)
AWSRequestMetrics.addProperty(String, Object)
public final AWSRequestMetrics addPropertyWith(MetricType f, Object value)
AWSRequestMetrics.addProperty(MetricType, Object)
public void log()
public List<Object> getProperty(MetricType f)
Copyright © 2024. All rights reserved.