Package org.apache.storm.metricstore

# Class Metric

java.lang.Object
org.apache.storm.metricstore.Metric

All Implemented Interfaces:
  `Comparable<Metric>`

public class Metric extends Object implements Comparable<Metric>
Class containing metric values and all identifying fields to be stored in a MetricStore.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Metric(String name, Long timestamp, String topologyId, double value, String componentId, String executorId, String hostname, String streamId, int port, AggLevel aggLevel)`
  Metric constructor.
  `Metric(Metric o)`
  A Metric constructor with the same settings cloned from another.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addValue(double value)`
  Adds an additional value to the metric.
  `int`
  `compareTo(Metric o)`
  `boolean`
  `equals(Object other)`
  Check if a Metric matches another object.
  `AggLevel`
  `getAggLevel()`
  `String`
  `getComponentId()`
  `long`
  `getCount()`
  `String`
  `getExecutorId()`
  `String`
  `getHostname()`
  `double`
  `getMax()`
  `String`
  `getMetricName()`
  `double`
  `getMin()`
  `Integer`
  `getPort()`
  `String`
  `getStreamId()`
  `double`
  `getSum()`
  `long`
  `getTimestamp()`
  `String`
  `getTopologyId()`
  `double`
  `getValue()`
  `void`
  `setAggLevel(AggLevel aggLevel)`
  Set the aggLevel.
  `void`
  `setCount(long count)`
  `void`
  `setMax(double max)`
  `void`
  `setMin(double min)`
  `void`
  `setSum(double sum)`
  `void`
  `setTimestamp(long timestamp)`
  `void`
  `setTopologyId(String topologyId)`
  `void`
  `setValue(double value)`
  Initialize the metric value.
  `String`
  `toString()`

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

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

- ## Constructor Details

  - ### Metric

    public Metric(String name, Long timestamp, String topologyId, double value, String componentId, String executorId, String hostname, String streamId, int port, AggLevel aggLevel) throws MetricException
    Metric constructor.
    Throws:
      `MetricException`

  - ### Metric

    public Metric(Metric o)
    A Metric constructor with the same settings cloned from another.

- ## Method Details

  - ### equals

    public boolean equals(Object other)
    Check if a Metric matches another object.
    Overrides:
      `equals` in class `Object`

  - ### getAggLevel

    public AggLevel getAggLevel()

  - ### setAggLevel

    public void setAggLevel(AggLevel aggLevel) throws MetricException
    Set the aggLevel.
    Throws:
      `MetricException`

  - ### addValue

    public void addValue(double value)
    Adds an additional value to the metric.

  - ### getSum

    public double getSum()

  - ### setSum

    public void setSum(double sum)

  - ### getCount

    public long getCount()

  - ### setCount

    public void setCount(long count)

  - ### getMin

    public double getMin()

  - ### setMin

    public void setMin(double min)

  - ### getMax

    public double getMax()

  - ### setMax

    public void setMax(double max)

  - ### getTopologyId

    public String getTopologyId()

  - ### setTopologyId

    public void setTopologyId(String topologyId)

  - ### getTimestamp

    public long getTimestamp()

  - ### setTimestamp

    public void setTimestamp(long timestamp)

  - ### getValue

    public double getValue()

  - ### setValue

    public void setValue(double value)
    Initialize the metric value.

  - ### getMetricName

    public String getMetricName()

  - ### getComponentId

    public String getComponentId()

  - ### getExecutorId

    public String getExecutorId()

  - ### getHostname

    public String getHostname()

  - ### getStreamId

    public String getStreamId()

  - ### getPort

    public Integer getPort()

  - ### compareTo

    public int compareTo(Metric o)
    Specified by:
      `compareTo` in interface `Comparable<Metric>`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`