java.lang.Object
com.yahoo.vespa.model.admin.monitoring.Metric

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

    • name

      public final String name
    • outputName

      public final String outputName
    • description

      public final String description
    • dimensions

      public final Map<String,String> dimensions
  • Constructor Details

    • Metric

      public Metric(String name, String outputName, String description, Map<String,String> dimensions)
    • Metric

      public Metric(String name, String outputName, String description)
    • 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 Details

    • 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.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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