Package org.apache.storm.metric.api

## Interface IMetric

- All Known Subinterfaces:
    `IShellMetric`
  All Known Implementing Classes:
    `AssignableMetric`, `AssignableShellMetric`, `CGroupCpu`, `CGroupCpuGuarantee`, `CGroupCpuGuaranteeByCfsQuota`, `CGroupMemoryLimit`, `CGroupMemoryUsage`, `CGroupMetricsBase`, `CombinedMetric`, `CombinedShellMetric`, `CountMetric`, `CountShellMetric`, `CPUMetric`, `DeserializingConnectionCallback`, `HistogramMetric`, `MultiCountMetric`, `MultiReducedMetric`, `ReducedMetric`, `ReducedShellMetric`, `StateMetric`

      public interface IMetric

  Produces metrics. Usually, metric is a measurement identified by a name string. Dimensions are a collection of additional key-value metadata map containing extra information of this measurement. It is optional when customizing your metric by implementing this interface

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `default Map<String,​String>` | `getDimensions()` | Get dimension map.
    `Object` | `getValueAndReset()` | Get value and reset.

- - ### Method Detail

    - #### getValueAndReset

          Object getValueAndReset()

      Get value and reset.
      Returns:
        an object that will be sent to `IMetricsConsumer.handleDataPoints(org.apache.storm.metric.api.IMetricsConsumer.TaskInfo, java.util.Collection)`. If `null` is returned nothing will be sent. If this value can be reset, like with a counter, a side effect of calling this should be that the value is reset.

    - #### getDimensions

          default Map<String,​String> getDimensions()

      Get dimension map. An empty map will be returned if metric is not dimensional.
      Returns:
        a K-V map of the additional metadata.