Package fish.payara.jdbc.stats
Class SlowSqlTraceCache
- java.lang.Object
-
- com.sun.gjc.util.SQLTraceCache
-
- fish.payara.jdbc.stats.SlowSqlTraceCache
-
public class SlowSqlTraceCache extends SQLTraceCache
- Author:
- Andrew Pielage
-
-
Field Summary
-
Fields inherited from class com.sun.gjc.util.SQLTraceCache
_logger, cache, LINE_BREAK, numTopQueriesToReport, poolName, timeToKeepQueries
-
-
Constructor Summary
Constructors Constructor Description SlowSqlTraceCache(String poolName, int maxNumberOfQueries, long timeToKeepQueries)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkAndUpdateCache(SQLTrace sqlTrace)
Request for adding a sql query in the form of SlowSqlTrace to this cache.List<SlowSqlTrace>
getSlowestSqlQueries()
Returns the slowest SQL traces.void
purgeEntries()
Overrides the purgeEntries method to purge the quickest running SQL Traces-
Methods inherited from class com.sun.gjc.util.SQLTraceCache
cancelTimerTask, getPoolName, getSqlTraceList, scheduleTimerTask
-
-
-
-
Constructor Detail
-
SlowSqlTraceCache
public SlowSqlTraceCache(String poolName, int maxNumberOfQueries, long timeToKeepQueries)
-
-
Method Detail
-
checkAndUpdateCache
public void checkAndUpdateCache(SQLTrace sqlTrace)
Request for adding a sql query in the form of SlowSqlTrace to this cache. If the query is already found in the list, the number of times it is executed is incremented by one along with the timestamp. If its slowest execution time has also increased, this is updated. If the query is a new one, it is added to the list.- Specified by:
checkAndUpdateCache
in classSQLTraceCache
- Parameters:
sqlTrace
-
-
purgeEntries
public void purgeEntries()
Overrides the purgeEntries method to purge the quickest running SQL Traces- Overrides:
purgeEntries
in classSQLTraceCache
-
getSlowestSqlQueries
public List<SlowSqlTrace> getSlowestSqlQueries()
Returns the slowest SQL traces.- Returns:
- A String representation of the slowest SQL Traces
-
-