Record Class LatestInteraction

java.lang.Object
java.lang.Record
com.vaadin.observability.micrometer.insights.LatestInteraction
Record Components:
timestamp - when the last invocation of the interaction ended
route - the route template the view was on
view - the simple class name of the active navigation target, or null
component - the class name of the component the user worked, or null
caption - the component's caption, or null
event - the event name, e.g. click
outcome - CapturedInteraction.OUTCOME_SUCCESS or CapturedInteraction.OUTCOME_ERROR
serverMs - the time the application's listeners took, summed over every invocation the request carried
invocations - how many invocations the request carried

public record LatestInteraction(Instant timestamp, String route, String view, String component, String caption, String event, String outcome, double serverMs, int invocations) extends Record
The most recent user interaction, whatever its outcome or duration, as the development-mode Copilot panel shows it under "your last interaction".

Unlike a CapturedInteraction this is not evidence for an insight: nothing went wrong, and only one is ever kept. It is recorded in development mode only, since the caption it carries is read off the screen.

  • Constructor Details

    • LatestInteraction

      public LatestInteraction(Instant timestamp, String route, String view, String component, String caption, String event, String outcome, double serverMs, int invocations)
      Creates an instance of a LatestInteraction record class.
      Parameters:
      timestamp - the value for the timestamp record component
      route - the value for the route record component
      view - the value for the view record component
      component - the value for the component record component
      caption - the value for the caption record component
      event - the value for the event record component
      outcome - the value for the outcome record component
      serverMs - the value for the serverMs record component
      invocations - the value for the invocations record component
  • Method Details

    • 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.
    • timestamp

      public Instant timestamp()
      Returns the value of the timestamp record component.
      Returns:
      the value of the timestamp record component
    • route

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

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

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

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

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

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

      public double serverMs()
      Returns the value of the serverMs record component.
      Returns:
      the value of the serverMs record component
    • invocations

      public int invocations()
      Returns the value of the invocations record component.
      Returns:
      the value of the invocations record component