Class QueryTimeoutEvent

All Implemented Interfaces:
DurationAwareEvent, Event, Serializable

public class QueryTimeoutEvent extends QueryEvent implements DurationAwareEvent
The QueryTimeoutEvent indicates that one of the application queries has been running for more than the maximum allowed time threshold, which is given by the Config.Property.Query.TIMEOUT_MILLIS property value. Long-running queries should be avoided because they impact user experience, consume resources, and prevent other concurrent requests from using the acquired resources (e.g., database connections).
Since:
2.5.0
Author:
Vlad Mihalcea
See Also:
  • Constructor Details

    • QueryTimeoutEvent

      public QueryTimeoutEvent(String queryString, long queryTimeNanos)
      Instantiate the event using the provided parameters.
      Parameters:
      queryString - query string
      queryTimeNanos - query execution time
  • Method Details

    • getQueryTimeNanos

      public long getQueryTimeNanos()
      Get the execution time of the JPA or Hibernate query in nanoseconds.
      Returns:
      the execution time of the JPA or Hibernate query in nanoseconds
    • getQueryTimeMillis

      public long getQueryTimeMillis()
      Get the execution time of the JPA or Hibernate query in milliseconds.
      Returns:
      the execution time of the JPA or Hibernate query in milliseconds
    • getDurationMillis

      public long getDurationMillis()
      Get the duration, in milliseconds, associated with this Event.
      Specified by:
      getDurationMillis in interface DurationAwareEvent
      Returns:
      the duration, in milliseconds, associated with this Event
    • getPriority

      public Event.Priority getPriority()
      Get the Event.Priority of this Event
      Specified by:
      getPriority in interface Event
      Returns:
      the Event.Priority of this Event
    • getDescription

      public String getDescription()
      Get the String description of this Event
      Specified by:
      getDescription in interface Event
      Returns:
      the String description of this Event