Package org.apache.iceberg.metrics
Interface MetricsContext
-
- All Superinterfaces:
java.io.Serializable
- All Known Subinterfaces:
FileIOMetricsContext
- All Known Implementing Classes:
DefaultMetricsContext
,HadoopMetricsContext
public interface MetricsContext extends java.io.Serializable
Generalized interface for creating telemetry related instances for tracking operations. Implementations must take into account usage considerations like thread safety and serialization.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
MetricsContext.Counter<T extends java.lang.Number>
Deprecated.will be removed in 2.0.0, useCounter
instead.static class
MetricsContext.Unit
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Deprecated Methods Modifier and Type Method Description default Counter
counter(java.lang.String name)
Get a named counter usingMetricsContext.Unit.COUNT
default <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(String, Unit)
instead.default Counter
counter(java.lang.String name, MetricsContext.Unit unit)
Get a named counter.default Histogram
histogram(java.lang.String name)
default void
initialize(java.util.Map<java.lang.String,java.lang.String> properties)
static MetricsContext
nullMetrics()
Utility method for producing no metrics.default Timer
timer(java.lang.String name, java.util.concurrent.TimeUnit unit)
Get a named timer.
-
-
-
Method Detail
-
initialize
default void initialize(java.util.Map<java.lang.String,java.lang.String> properties)
-
counter
@Deprecated default <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(String, Unit)
instead.Get a named counter of a specific type. Metric implementations may impose restrictions on what types are supported for specific counters.- Parameters:
name
- name of the metrictype
- numeric type of the counter valueunit
- the unit designation of the metric- Returns:
- a counter implementation
-
counter
default Counter counter(java.lang.String name, MetricsContext.Unit unit)
Get a named counter.- Parameters:
name
- The name of the counterunit
- The unit designation of the counter- Returns:
- a
Counter
implementation
-
counter
default Counter counter(java.lang.String name)
Get a named counter usingMetricsContext.Unit.COUNT
- Parameters:
name
- The name of the counter- Returns:
- a
Counter
implementation
-
timer
default Timer timer(java.lang.String name, java.util.concurrent.TimeUnit unit)
Get a named timer.- Parameters:
name
- name of the metricunit
- the time unit designation of the metric- Returns:
- a timer implementation
-
histogram
default Histogram histogram(java.lang.String name)
-
nullMetrics
static MetricsContext nullMetrics()
Utility method for producing no metrics.- Returns:
- a non-recording metrics context
-
-