Class Metric


  • @Immutable
    public class Metric
    extends Object
    Helper class to model a metric.
    Author:
    trygve, gjoranv
    • Field Detail

      • name

        public final String name
      • outputName

        public final String outputName
      • description

        public final String description
    • Constructor Detail

      • Metric

        public Metric​(String name,
                      String outputName)
        Creates a metric with empty description
      • Metric

        public Metric​(String name)
        Creates a metric with same outputname as metricname
        Parameters:
        name - The name of the metric, same name used for output name
    • Method Detail

      • addDimensionsFrom

        public Metric addDimensionsFrom​(Metric other)
        Returns a new Metric that is a combination of this and the given metric. New dimensions from the given metric are added, but already existing dimensions will be kept unchanged.
        Parameters:
        other - The metric to add dimensions from.
        Returns:
        A new metric with dimensions from this and the other.
      • equals

        public boolean equals​(Object o)
        Two metrics are considered equal if they have the same name.
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object