Record Class SpanCompute

java.lang.Object
java.lang.Record
codes.grow.packages.datadogapm.SpanCompute
Record Components:
aggregation - one of the AGGREGATION_* constants
metric - measure, e.g. @duration (null for count)
type - total (default when null) or timeseries (all computes must use the same type and interval)
interval - time bucket for timeseries, e.g. 5m, or null

public record SpanCompute(String aggregation, String metric, String type, String interval) extends Record
  • Field Details

  • Constructor Details

    • SpanCompute

      public SpanCompute(String aggregation, String metric, String type, String interval)
      Validates the aggregation.
      Parameters:
      aggregation - aggregation
      metric - metric
      type - type
      interval - interval
  • Method Details

    • of

      public static SpanCompute of(String aggregation)
      A total compute without a metric (for example count).
      Parameters:
      aggregation - aggregation
      Returns:
      compute
    • of

      public static SpanCompute of(String aggregation, String metric)
      A total compute over a metric.
      Parameters:
      aggregation - aggregation
      metric - metric, e.g. @duration
      Returns:
      compute
    • timeseries

      public static SpanCompute timeseries(String aggregation, String metric, String interval)
      A timeseries compute.
      Parameters:
      aggregation - aggregation
      metric - metric or null
      interval - bucket, e.g. 5m
      Returns:
      compute
    • 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.
    • aggregation

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

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

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

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