Interface MetricsContext

  • All Superinterfaces:
    java.io.Serializable
    All Known Subinterfaces:
    FileIOMetricsContext
    All Known Implementing Classes:
    HadoopMetricsContext, ReaderMetricsContext

    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.
    • Method Detail

      • initialize

        default void initialize​(java.util.Map<java.lang.String,​java.lang.String> properties)
      • counter

        default <T extends java.lang.Number> MetricsContext.Counter<T> counter​(java.lang.String name,
                                                                               java.lang.Class<T> type,
                                                                               MetricsContext.Unit unit)
        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 metric
        type - numeric type of the counter value
        unit - the unit designation of the metric
        Returns:
        a counter implementation
      • nullMetrics

        static MetricsContext nullMetrics()
        Utility method for producing no metrics.
        Returns:
        a non-recording metrics context