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

Projects
None yet
8 participants
@Pandrex247
Copy link
Member

commented Jun 2, 2017

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

This comment has been minimized.

Copy link
Member Author

commented Jun 5, 2017

Jenkins, would you kindly?

@payara-ci

This comment has been minimized.

Copy link
Contributor

commented Jun 5, 2017

One or more tests have failed

@Cousjava

This comment has been minimized.

Copy link
Member

commented Jun 5, 2017

jenkins test please

@payara-ci

This comment has been minimized.

Copy link
Contributor

commented Jun 5, 2017

One or more tests have failed

@mulderbaba

This comment has been minimized.

Copy link
Contributor

commented Jun 5, 2017

jenkins test please

@payara-ci

This comment has been minimized.

Copy link
Contributor

commented Jun 6, 2017

One or more tests have failed

@smillidge

This comment has been minimized.

Copy link
Contributor

commented Jun 13, 2017

jenkins test please

@payara-ci

This comment has been minimized.

Copy link
Contributor

commented Jun 13, 2017

One or more tests have failed

public String getTopQueries() {
purgeEntries();

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

This comment has been minimized.

Copy link
@lprimak

lprimak Jun 15, 2017

Contributor

Should be ArrayList<> instead of raw type

@lprimak
Copy link
Contributor

left a comment

Looks good except for "raw" types

@lprimak

This comment has been minimized.

Copy link
Contributor

commented Jun 15, 2017

Jenkins, would you kindly?

1 similar comment
@lprimak

This comment has been minimized.

Copy link
Contributor

commented Jun 15, 2017

Jenkins, would you kindly?

@payara-ci

This comment has been minimized.

Copy link
Contributor

commented Jun 15, 2017

One or more tests have failed

@arjantijms

This comment has been minimized.

Copy link
Member

commented Jun 15, 2017

Jenkins, would you kindly?

@payara-ci

This comment has been minimized.

Copy link
Contributor

commented Jun 15, 2017

One or more tests have failed

@payara-ci

This comment has been minimized.

Copy link
Contributor

commented Jun 16, 2017

All tests have passed

@arjantijms arjantijms merged commit b80edb0 into payara:master Jun 16, 2017

3 checks passed

JDK7 Ubuntu Builder JDK7 Build Passed.
Details
JDK7 Ubuntu Tester JDK7 tests passed.
Details
Jenkins Job Handler All builds and tests successfully completed.
Details

@smillidge smillidge added this to the Payara 173 milestone Jul 13, 2017

@Pandrex247 Pandrex247 deleted the Pandrex247:PAYARA-1133-Slow-SQL-Logger-should-keep-Top-and-Slowest-SQL-Traces-Rebase branch Aug 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.