Record Class EppMetric

java.lang.Object
java.lang.Record
google.registry.monitoring.whitebox.EppMetric

public record EppMetric(org.joda.time.DateTime startTimestamp, org.joda.time.DateTime endTimestamp, Optional<String> commandName, Optional<String> registrarId, Optional<String> tld, Optional<Result.Code> status) extends Record
A record for recording attributes of an EPP metric.
  • Constructor Details

    • EppMetric

      public EppMetric(org.joda.time.DateTime startTimestamp, org.joda.time.DateTime endTimestamp, Optional<String> commandName, Optional<String> registrarId, Optional<String> tld, Optional<Result.Code> status)
      Creates an instance of a EppMetric record class.
      Parameters:
      startTimestamp - the value for the startTimestamp record component
      endTimestamp - the value for the endTimestamp record component
      commandName - the value for the commandName record component
      registrarId - the value for the registrarId record component
      tld - the value for the tld record component
      status - the value for the status record component
  • Method Details

    • builder

      public static EppMetric.Builder builder()
    • builderForRequest

      public static EppMetric.Builder builderForRequest(Clock clock)
      Create an EppMetric.Builder for a request context, with the given request ID and with start and end timestamps taken from the given clock.

      The start timestamp is recorded now, and the end timestamp at build().

    • getStartTimestamp

      public org.joda.time.DateTime getStartTimestamp()
    • getEndTimestamp

      public org.joda.time.DateTime getEndTimestamp()
    • getCommandName

      public Optional<String> getCommandName()
    • getRegistrarId

      public Optional<String> getRegistrarId()
    • getTld

      public Optional<String> getTld()
    • getStatus

      public Optional<Result.Code> getStatus()
    • 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.
    • startTimestamp

      public org.joda.time.DateTime startTimestamp()
      Returns the value of the startTimestamp record component.
      Returns:
      the value of the startTimestamp record component
    • endTimestamp

      public org.joda.time.DateTime endTimestamp()
      Returns the value of the endTimestamp record component.
      Returns:
      the value of the endTimestamp record component
    • commandName

      public Optional<String> commandName()
      Returns the value of the commandName record component.
      Returns:
      the value of the commandName record component
    • registrarId

      public Optional<String> registrarId()
      Returns the value of the registrarId record component.
      Returns:
      the value of the registrarId record component
    • tld

      public Optional<String> tld()
      Returns the value of the tld record component.
      Returns:
      the value of the tld record component
    • status

      public Optional<Result.Code> status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component