Class Metric
- java.lang.Object
-
- com.yahoo.vespa.model.admin.monitoring.Metric
-
@Immutable public class Metric extends java.lang.Object
Helper class to model a metric.- Author:
- trygve, gjoranv
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.String
description
java.util.Map<java.lang.String,java.lang.String>
dimensions
java.lang.String
name
java.lang.String
outputName
-
Constructor Summary
Constructors Constructor Description Metric(java.lang.String name)
Creates a metric with same outputname as metricnameMetric(java.lang.String name, java.lang.String outputName)
Creates a metric with empty descriptionMetric(java.lang.String name, java.lang.String outputName, java.lang.String description)
Metric(java.lang.String name, java.lang.String outputName, java.lang.String description, java.util.Map<java.lang.String,java.lang.String> dimensions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Metric
addDimensionsFrom(Metric other)
Returns a new Metric that is a combination of this and the given metric.boolean
equals(java.lang.Object o)
Two metrics are considered equal if they have the same name.int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
Metric
public Metric(java.lang.String name, java.lang.String outputName, java.lang.String description, java.util.Map<java.lang.String,java.lang.String> dimensions)
-
Metric
public Metric(java.lang.String name, java.lang.String outputName, java.lang.String description)
-
Metric
public Metric(java.lang.String name, java.lang.String outputName)
Creates a metric with empty description
-
Metric
public Metric(java.lang.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.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
Two metrics are considered equal if they have the same name.- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-