Skip to content
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

Conversation

Pandrex247
Copy link
Member

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:

asadmin set server.resources.jdbc-connection-pool.<POOL_NAME>.property.number-of-top-queries-to-report=15                    
asadmin set server.resources.jdbc-connection-pool.<POOL_NAME>.property.time-to-keep-queries-in-minutes=10  

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.

@Pandrex247 Pandrex247 changed the title PAYARA-1133 slow sql logger should keep top and slowest sql traces rebase PAYARA-1133 Slow SQL logger should keep the top and slowest SQL traces Jun 2, 2017
@Pandrex247
Copy link
Member Author

Jenkins, would you kindly?

@payara-ci
Copy link
Contributor

One or more tests have failed

@Cousjava
Copy link
Contributor

Cousjava commented Jun 5, 2017

jenkins test please

@payara-ci
Copy link
Contributor

One or more tests have failed

@mulderbaba
Copy link
Contributor

jenkins test please

@payara-ci
Copy link
Contributor

One or more tests have failed

@smillidge
Copy link
Contributor

jenkins test please

@payara-ci
Copy link
Contributor

One or more tests have failed

public String getTopQueries() {
purgeEntries();

List<SQLTrace> sqlTraceList = new ArrayList(cache.values());
Copy link
Contributor

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

Copy link
Contributor

@lprimak lprimak left a 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

@lprimak
Copy link
Contributor

lprimak commented Jun 15, 2017

Jenkins, would you kindly?

1 similar comment
@lprimak
Copy link
Contributor

lprimak commented Jun 15, 2017

Jenkins, would you kindly?

@payara-ci
Copy link
Contributor

One or more tests have failed

@arjantijms
Copy link
Contributor

Jenkins, would you kindly?

@payara-ci
Copy link
Contributor

One or more tests have failed

@payara-ci
Copy link
Contributor

All tests have passed

@arjantijms arjantijms merged commit b80edb0 into payara:master Jun 16, 2017
@smillidge smillidge added this to the Payara 173 milestone Jul 13, 2017
@Pandrex247 Pandrex247 deleted the PAYARA-1133-Slow-SQL-Logger-should-keep-Top-and-Slowest-SQL-Traces-Rebase branch August 29, 2018 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants