Record Class AppEvent

java.lang.Object
java.lang.Record
com.cockroachlabs.data.continuum.aegis.AppEvent
Record Components:
kind - event kind, e.g. retry, circuit_open
source - originating component (class/method)
attrs - arbitrary structured attributes
epochMillis - event timestamp; pass explicitly for deterministic tests

public record AppEvent(String kind, String source, Map<String,Object> attrs, long epochMillis) extends Record
An application-side operational event published to Cockroach Aegis ("exhaust"). The library sees app intent + DB behavior the cluster alone cannot attribute (retry storms, circuit trips), so this feeds Aegis high-signal data.
  • Constructor Details

    • AppEvent

      public AppEvent(String kind, String source, Map<String,Object> attrs, long epochMillis)
      Creates an instance of a AppEvent record class.
      Parameters:
      kind - the value for the kind record component
      source - the value for the source record component
      attrs - the value for the attrs record component
      epochMillis - the value for the epochMillis record component
  • Method Details

    • now

      public static AppEvent now(String kind, String source, Map<String,Object> attrs)
      Convenience factory stamping System.currentTimeMillis().
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • kind

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

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

      public Map<String,Object> attrs()
      Returns the value of the attrs record component.
      Returns:
      the value of the attrs record component
    • epochMillis

      public long epochMillis()
      Returns the value of the epochMillis record component.
      Returns:
      the value of the epochMillis record component