Class HeavyQueriesTracker


  • public final class HeavyQueriesTracker
    extends Object
    Class to track heavy queries (long-running or producing a big result-set).
    • Constructor Detail

      • HeavyQueriesTracker

        public HeavyQueriesTracker​(GridKernalContext ctx)
        Parameters:
        ctx - Kernal context.
    • Method Detail

      • stop

        public void stop()
      • startTracking

        public void startTracking​(TrackableQuery qryInfo)
        Parameters:
        qryInfo - Query info to register.
      • stopTracking

        public void stopTracking​(TrackableQuery qryInfo,
                                 @Nullable
                                 @Nullable Throwable err)
        Parameters:
        qryInfo - Query info to remove.
        err - Exception if query executed with error.
      • getTimeout

        public long getTimeout()
        Returns:
        Timeout in milliseconds after which long query warning will be printed.
      • setTimeout

        public void setTimeout​(long timeout)
        Sets timeout in milliseconds after which long query warning will be printed.
        Parameters:
        timeout - Timeout in milliseconds after which long query warning will be printed.
      • getTimeoutMultiplier

        public int getTimeoutMultiplier()
        Returns:
        Long query timeout multiplier.
      • setTimeoutMultiplier

        public void setTimeoutMultiplier​(int timeoutMult)
        Sets long query timeout multiplier. The warning will be printed after: - timeout; - timeout * multiplier; - timeout * multiplier * multiplier; - etc... If the multiplier <= 1, the warning message is printed once.
        Parameters:
        timeoutMult - Long query timeout multiplier.
      • getResultSetSizeThreshold

        public long getResultSetSizeThreshold()
        Returns:
        Threshold result's row count, when count of fetched rows is bigger than the threshold warning will be printed.
      • setResultSetSizeThreshold

        public void setResultSetSizeThreshold​(long rsSizeThreshold)
        Sets threshold result's row count, when count of fetched rows is bigger than the threshold warning will be printed.
        Parameters:
        rsSizeThreshold - Threshold result's row count, when count of fetched rows is bigger than the threshold warning will be printed.
      • getResultSetSizeThresholdMultiplier

        public int getResultSetSizeThresholdMultiplier()
        Gets result set size threshold multiplier. The warning will be printed after: - size of result set > threshold; - size of result set > threshold * multiplier; - size of result set > threshold * multiplier * multiplier; - etc. If the multiplier <= 1, the warning message is printed once.
        Returns:
        Result set size threshold multiplier.
      • setResultSetSizeThresholdMultiplier

        public void setResultSetSizeThresholdMultiplier​(int rsSizeThresholdMult)
        Sets result set size threshold multiplier.
        Parameters:
        rsSizeThresholdMult - Result set size threshold multiplier