Class Metric

java.lang.Object
ai.vespa.metricsproxy.metric.Metric

public class Metric extends Object
Author:
Jo Kristian Bergum
  • Constructor Details

  • Method Details

    • setDimensions

      public void setDimensions(Map<DimensionId,String> dimensions)
    • getDimensions

      public Map<DimensionId,String> getDimensions()
      Returns:
      A map of the dimensions registered for this metric
    • setConsumers

      public void setConsumers(Set<ConsumerId> consumers)
    • getConsumers

      public Set<ConsumerId> getConsumers()
      Returns:
      The consumers this metric should be routed to.
    • getValue

      public Number getValue()
      Returns:
      The number that this metric name represent
    • setName

      public void setName(MetricId name)
      Set the name of this metric
      Parameters:
      name - The name to use for this metric
    • getName

      public MetricId getName()
      Returns:
      The name of the metric
    • getTimeStamp

      public Instant getTimeStamp()
      Returns:
      The UTC timestamp for when this metric was collected
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • clone

      public Metric clone()
      Overrides:
      clone in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getDescription

      public String getDescription()
      Returns:
      the description of this metric
    • adjustTime

      public static long adjustTime(long timestamp, long now)
      Return an adjusted (rounded up) time if necessary