Package org.apache.storm.metric.api

# Class CountMetric

java.lang.Object
org.apache.storm.metric.api.CountMetric

All Implemented Interfaces:
  `IMetric`

Direct Known Subclasses:
  `CountShellMetric`

public class CountMetric extends Object implements IMetric

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CountMetric()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `getValueAndReset()`
  Get value and reset.
  `void`
  `incr()`
  `void`
  `incrBy(long incrementBy)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface org.apache.storm.metric.api.IMetric

  `getDimensions`

- ## Constructor Details

  - ### CountMetric

    public CountMetric()

- ## Method Details

  - ### incr

    public void incr()

  - ### incrBy

    public void incrBy(long incrementBy)

  - ### getValueAndReset

    public Object getValueAndReset()
    Description copied from interface: `IMetric`
    Get value and reset.
    Specified by:
      `getValueAndReset` in interface `IMetric`
    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.