Record Class Metric

java.lang.Object
java.lang.Record
io.vertigo.core.analytics.metric.Metric

public record Metric(Instant measureInstant, String name, String module, String feature, Double value, Metric.Status status) extends Record
A Metric represents a measurement or observation at a specific point in time.
Author:
mlaroche, pchretien
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    The status of a metric can be either SUCCESS or ERROR.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Metric(Instant measureInstant, String name, String module, String feature, Double value, Metric.Status status)
    Constructor for Metric.
  • Method Summary

    Modifier and Type
    Method
    Description
    Static method factory for creating a MetricBuilder.
    final boolean
    Indicates whether some other object is "equal to" this one.
    Returns the value of the feature record component.
    final int
    Returns a hash code value for this object.
    Returns the value of the measureInstant record component.
    Returns the value of the module record component.
    Returns the value of the name record component.
    Returns the value of the status record component.
    final String
    Returns a string representation of this record class.
    Returns the value of the value record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Metric

      public Metric(Instant measureInstant, String name, String module, String feature, Double value, Metric.Status status)
      Constructor for Metric.
      Parameters:
      measureInstant - The instant at which the metric was measured.
      name - The name of the metric.
      module - The module associated with the metric. May be null.
      feature - The feature associated with the metric.
      value - The value of the metric. May be null.
      status - The status of the metric.
  • Method Details

    • builder

      public static MetricBuilder builder()
      Static method factory for creating a MetricBuilder.
      Returns:
      A new MetricBuilder instance.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • measureInstant

      public Instant measureInstant()
      Returns the value of the measureInstant record component.
      Returns:
      the value of the measureInstant record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • module

      public String module()
      Returns the value of the module record component.
      Returns:
      the value of the module record component
    • feature

      public String feature()
      Returns the value of the feature record component.
      Returns:
      the value of the feature record component
    • value

      public Double value()
      Returns the value of the value record component.
      Returns:
      the value of the value record component
    • status

      public Metric.Status status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component