Class SlowSqlTraceCache


  • public class SlowSqlTraceCache
    extends SQLTraceCache
    Author:
    Andrew Pielage
    • 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 class SQLTraceCache
        Parameters:
        sqlTrace -
      • purgeEntries

        public void purgeEntries()
        Overrides the purgeEntries method to purge the quickest running SQL Traces
        Overrides:
        purgeEntries in class SQLTraceCache
      • getSlowestSqlQueries

        public List<SlowSqlTrace> getSlowestSqlQueries()
        Returns the slowest SQL traces.
        Returns:
        A String representation of the slowest SQL Traces