Package org.apache.iceberg.metrics
Class DefaultMetricsContext
- java.lang.Object
-
- org.apache.iceberg.metrics.DefaultMetricsContext
-
- All Implemented Interfaces:
java.io.Serializable
,MetricsContext
public class DefaultMetricsContext extends java.lang.Object implements MetricsContext
A defaultMetricsContext
implementation that uses native Java counters/timers.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.iceberg.metrics.MetricsContext
MetricsContext.Counter<T extends java.lang.Number>, MetricsContext.Unit
-
-
Constructor Summary
Constructors Constructor Description DefaultMetricsContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description <T extends java.lang.Number>
MetricsContext.Counter<T>counter(java.lang.String name, java.lang.Class<T> type, MetricsContext.Unit unit)
Deprecated.will be removed in 2.0.0, useCounter
instead.Counter
counter(java.lang.String name, MetricsContext.Unit unit)
Get a named counter.Histogram
histogram(java.lang.String name)
Timer
timer(java.lang.String name, java.util.concurrent.TimeUnit unit)
Get a named timer.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.iceberg.metrics.MetricsContext
counter, initialize
-
-
-
-
Method Detail
-
counter
@Deprecated public <T extends java.lang.Number> MetricsContext.Counter<T> counter(java.lang.String name, java.lang.Class<T> type, MetricsContext.Unit unit)
Deprecated.will be removed in 2.0.0, useCounter
instead.Description copied from interface:MetricsContext
Get a named counter of a specific type. Metric implementations may impose restrictions on what types are supported for specific counters.- Specified by:
counter
in interfaceMetricsContext
- Parameters:
name
- name of the metrictype
- numeric type of the counter valueunit
- the unit designation of the metric- Returns:
- a counter implementation
-
timer
public Timer timer(java.lang.String name, java.util.concurrent.TimeUnit unit)
Description copied from interface:MetricsContext
Get a named timer.- Specified by:
timer
in interfaceMetricsContext
- Parameters:
name
- name of the metricunit
- the time unit designation of the metric- Returns:
- a timer implementation
-
counter
public Counter counter(java.lang.String name, MetricsContext.Unit unit)
Description copied from interface:MetricsContext
Get a named counter.- Specified by:
counter
in interfaceMetricsContext
- Parameters:
name
- The name of the counterunit
- The unit designation of the counter- Returns:
- a
Counter
implementation
-
histogram
public Histogram histogram(java.lang.String name)
- Specified by:
histogram
in interfaceMetricsContext
-
-