-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PAYARA-1133 Slow SQL logger should keep the top and slowest SQL traces #1645
PAYARA-1133 Slow SQL logger should keep the top and slowest SQL traces #1645
Conversation
…ce listener to an empty String to prevent the new default kicking in
Jenkins, would you kindly? |
One or more tests have failed |
jenkins test please |
One or more tests have failed |
jenkins test please |
One or more tests have failed |
jenkins test please |
One or more tests have failed |
public String getTopQueries() { | ||
purgeEntries(); | ||
|
||
List<SQLTrace> sqlTraceList = new ArrayList(cache.values()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be ArrayList<> instead of raw type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good except for "raw" types
Jenkins, would you kindly? |
1 similar comment
Jenkins, would you kindly? |
One or more tests have failed |
Jenkins, would you kindly? |
One or more tests have failed |
All tests have passed |
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:
asadmin set server.monitoring-service.module-monitoring-levels.jdbc-connection-pool=HIGH
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
asadmin get -m server.resources.<POOL_NAME>.slowSqlQueries-current
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.