Record Class CapturedQuery

java.lang.Object
java.lang.Record
com.vaadin.observability.micrometer.insights.CapturedQuery
Record Components:
timestamp - when the query finished
route - the route template of the view the query belongs to, so every parameter value groups under one insight
component - fully-qualified class of the component whose data was loaded, or null when the data communicator is driven by a bare element
kind - KIND_COUNT or KIND_FETCH
filtered - whether the query carried a filter, which distinguishes a combo box loading matches for typed text from one loading everything
offset - index of the first item requested, -1 for a count
limit - number of items requested, -1 for a count
rows - for a fetch, the items actually returned; for a count, the reported item total; -1 when the query threw
durationMs - how long the query took, in milliseconds
thresholdMs - the budget this query was measured against, -1 when it was not retained for being slow
outcome - OUTCOME_SUCCESS or OUTCOME_ERROR
exceptionType - fully-qualified class of the throwable, null for successful queries

public record CapturedQuery(Instant timestamp, String route, String component, String kind, boolean filtered, int offset, int limit, int rows, long durationMs, long thresholdMs, String outcome, String exceptionType) extends Record
One captured data provider query worth surfacing as an insight: which component asked for data, on which route, how much it asked for, how much came back, and how long it took.

Kept separate from CapturedInteraction rather than folded into it. An interaction is a user action and carries a DOM event, an RPC type and, when it fails, a stack frame in application code. A query has none of those when it is merely slow, and carries a range and a row count instead. One record covering both would be mostly empty fields either way, and the JSON at the insights endpoint is a published contract, so a reader is better served by two honest shapes than one loose one.

  • Field Details

  • Constructor Details

    • CapturedQuery

      public CapturedQuery(Instant timestamp, String route, String component, String kind, boolean filtered, int offset, int limit, int rows, long durationMs, long thresholdMs, String outcome, String exceptionType)
      Creates an instance of a CapturedQuery record class.
      Parameters:
      timestamp - the value for the timestamp record component
      route - the value for the route record component
      component - the value for the component record component
      kind - the value for the kind record component
      filtered - the value for the filtered record component
      offset - the value for the offset record component
      limit - the value for the limit record component
      rows - the value for the rows record component
      durationMs - the value for the durationMs record component
      thresholdMs - the value for the thresholdMs record component
      outcome - the value for the outcome record component
      exceptionType - the value for the exceptionType 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
    • component

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

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

      public boolean filtered()
      Returns the value of the filtered record component.
      Returns:
      the value of the filtered record component
    • offset

      public int offset()
      Returns the value of the offset record component.
      Returns:
      the value of the offset record component
    • limit

      public int limit()
      Returns the value of the limit record component.
      Returns:
      the value of the limit record component
    • rows

      public int rows()
      Returns the value of the rows record component.
      Returns:
      the value of the rows record component
    • durationMs

      public long durationMs()
      Returns the value of the durationMs record component.
      Returns:
      the value of the durationMs record component
    • thresholdMs

      public long thresholdMs()
      Returns the value of the thresholdMs record component.
      Returns:
      the value of the thresholdMs record component
    • outcome

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

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