Package fish.payara.jdbc.stats
Class FrequentSQLTraceCache
- java.lang.Object
-
- com.sun.gjc.util.SQLTraceCache
-
- fish.payara.jdbc.stats.FrequentSQLTraceCache
-
public class FrequentSQLTraceCache extends SQLTraceCache
Maintains the Sql Tracing Cache used to store SQL statements used by the applications. This is used by the JDBCRA monitoring to display the most frequently used queries by applications.- Author:
- Shalini M
-
-
Field Summary
Fields Modifier and Type Field Description protected long
maxStoredEntries
-
Fields inherited from class com.sun.gjc.util.SQLTraceCache
_logger, cache, LINE_BREAK, numTopQueriesToReport, poolName, timeToKeepQueries
-
-
Constructor Summary
Constructors Constructor Description FrequentSQLTraceCache(String poolName, int numToReport, long timeToKeepQueries)
FrequentSQLTraceCache(String poolName, int numToReport, long timeToKeepQueries, long maxStoredEntries)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkAndUpdateCache(SQLTrace cacheObj)
Request for adding a sql query in the form of SQLTrace to this cache.List<SQLTrace>
getTopQueries()
Returns the String representation of the list of traced sql queries ordered by the number most frequently used, followed by the usage timestamp.-
Methods inherited from class com.sun.gjc.util.SQLTraceCache
cancelTimerTask, getPoolName, getSqlTraceList, purgeEntries, scheduleTimerTask
-
-
-
-
Method Detail
-
checkAndUpdateCache
public void checkAndUpdateCache(SQLTrace cacheObj)
Request for adding a sql query in the form of SQLTrace 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 the query is a new one, it is added to the list.- Specified by:
checkAndUpdateCache
in classSQLTraceCache
- Parameters:
cacheObj
-
-
getTopQueries
public List<SQLTrace> getTopQueries()
Returns the String representation of the list of traced sql queries ordered by the number most frequently used, followed by the usage timestamp. Only the top 'n' queries represented by the numTopQueriesToReport are chosen for display.- Returns:
- string representation of the list of sql queries sorted
-
-