Join GitHub today
PAYARA-1133 Slow SQL logger should keep the top and slowest SQL traces #1645
Adds the capability to monitor the slowest SQL traces executed against a connection pool.
To enable this, turn on monitoring of the JDBC Connection pools in a config, for example:
It is configured in the same way as the frequent SQL tracing, using the number-of-top-queries-to-report and time-to-keep-queries-in-minutes properties:
The monitoring figures can be viewed via the admin console (under Resources > Resource > JDBC Connection Pool Statistics), or using
For ease of use, I've also created a default SQL Trace listener that simply does nothing, as the monitoring of the slowest SQL traces requires an SQL Trace listener. This can be replaced with any other valid SQL Trace listener without affecting the monitoring (as far as I've tested anyway). The new default SQL Trace listener is now the default value of the sqlTraceListeners option for the create-jdbc-connection-pool command.
This PR also fixes monitoring of the most Frequent SQL Traces, though this still retains all of its previous shortcomings.