Class DefaultMetricCollector
- java.lang.Object
-
- software.amazon.awssdk.metrics.internal.DefaultMetricCollector
-
- All Implemented Interfaces:
MetricCollector
public final class DefaultMetricCollector extends Object implements MetricCollector
-
-
Constructor Summary
Constructors Constructor Description DefaultMetricCollector(String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MetricCollection
collect()
Return the collected metrics.static MetricCollector
create(String name)
MetricCollector
createChild(String name)
Create a child of this metric collector.String
name()
<T> void
reportMetric(SdkMetric<T> metric, T data)
Report a metric.String
toString()
-
-
-
Constructor Detail
-
DefaultMetricCollector
public DefaultMetricCollector(String name)
-
-
Method Detail
-
name
public String name()
- Specified by:
name
in interfaceMetricCollector
- Returns:
- The name of this collector.
-
reportMetric
public <T> void reportMetric(SdkMetric<T> metric, T data)
Description copied from interface:MetricCollector
Report a metric.- Specified by:
reportMetric
in interfaceMetricCollector
-
createChild
public MetricCollector createChild(String name)
Description copied from interface:MetricCollector
Create a child of this metric collector.- Specified by:
createChild
in interfaceMetricCollector
- Parameters:
name
- The name of the child collector.- Returns:
- The child collector.
-
collect
public MetricCollection collect()
Description copied from interface:MetricCollector
Return the collected metrics.Calling
collect()
prevents further invocations ofMetricCollector.reportMetric(SdkMetric, Object)
.- Specified by:
collect
in interfaceMetricCollector
- Returns:
- The collected metrics.
-
create
public static MetricCollector create(String name)
-
-