Class HeavyQueriesTracker
- java.lang.Object
-
- org.apache.ignite.internal.processors.query.running.HeavyQueriesTracker
-
public final class HeavyQueriesTracker extends Object
Class to track heavy queries (long-running or producing a big result-set).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHeavyQueriesTracker.ResultSetCheckerHolds result-set limit settings for the specified query.
-
Field Summary
Fields Modifier and Type Field Description static StringBIG_RESULT_SET_MSGstatic StringLONG_QUERY_ERROR_MSGstatic StringLONG_QUERY_EXEC_MSGMessage about the long execution of the query.static StringLONG_QUERY_FINISHED_MSG
-
Constructor Summary
Constructors Constructor Description HeavyQueriesTracker(GridKernalContext ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<TrackableQuery>getQueries()longgetResultSetSizeThreshold()intgetResultSetSizeThresholdMultiplier()Gets result set size threshold multiplier.longgetTimeout()intgetTimeoutMultiplier()HeavyQueriesTracker.ResultSetCheckerresultSetChecker(TrackableQuery qryInfo)Creates new result-set checker.voidsetResultSetSizeThreshold(long rsSizeThreshold)Sets threshold result's row count, when count of fetched rows is bigger than the threshold warning will be printed.voidsetResultSetSizeThresholdMultiplier(int rsSizeThresholdMult)Sets result set size threshold multiplier.voidsetTimeout(long timeout)Sets timeout in milliseconds after which long query warning will be printed.voidsetTimeoutMultiplier(int timeoutMult)Sets long query timeout multiplier.voidstartTracking(TrackableQuery qryInfo)voidstop()voidstopTracking(TrackableQuery qryInfo, @Nullable Throwable err)
-
-
-
Field Detail
-
LONG_QUERY_EXEC_MSG
public static final String LONG_QUERY_EXEC_MSG
Message about the long execution of the query.- See Also:
- Constant Field Values
-
LONG_QUERY_FINISHED_MSG
public static final String LONG_QUERY_FINISHED_MSG
- See Also:
- Constant Field Values
-
LONG_QUERY_ERROR_MSG
public static final String LONG_QUERY_ERROR_MSG
- See Also:
- Constant Field Values
-
BIG_RESULT_SET_MSG
public static final String BIG_RESULT_SET_MSG
- See Also:
- Constant Field Values
-
-
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.
-
resultSetChecker
public HeavyQueriesTracker.ResultSetChecker resultSetChecker(TrackableQuery qryInfo)
Creates new result-set checker.- Parameters:
qryInfo- Query info.
-
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
-
getQueries
public Set<TrackableQuery> getQueries()
-
-