Class DefaultMetricCollector
- java.lang.Object
-
- software.amazon.awssdk.metrics.internal.DefaultMetricCollector
-
- All Implemented Interfaces:
MetricCollector
@SdkInternalApi 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 MetricCollectioncollect()Return the collected metrics.static MetricCollectorcreate(String name)MetricCollectorcreateChild(String name)Create a child of this metric collector.Stringname()<T> voidreportMetric(SdkMetric<T> metric, T data)Report a metric.StringtoString()
-
-
-
Constructor Detail
-
DefaultMetricCollector
public DefaultMetricCollector(String name)
-
-
Method Detail
-
name
public String name()
- Specified by:
namein interfaceMetricCollector- Returns:
- The name of this collector.
-
reportMetric
public <T> void reportMetric(SdkMetric<T> metric, T data)
Description copied from interface:MetricCollectorReport a metric.- Specified by:
reportMetricin interfaceMetricCollector
-
createChild
public MetricCollector createChild(String name)
Description copied from interface:MetricCollectorCreate a child of this metric collector.- Specified by:
createChildin interfaceMetricCollector- Parameters:
name- The name of the child collector.- Returns:
- The child collector.
-
collect
public MetricCollection collect()
Description copied from interface:MetricCollectorReturn the collected metrics.Calling
collect()prevents further invocations ofMetricCollector.reportMetric(SdkMetric, Object).- Specified by:
collectin interfaceMetricCollector- Returns:
- The collected metrics.
-
create
public static MetricCollector create(String name)
-
-