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

[DatasourceProxy] How about allowing extending AbstractSlowQueryListener to make it easier to capture and customise actions for slow queries? #124

Open
TaeTaeKim opened this issue Feb 2, 2025 · 1 comment

Comments

@TaeTaeKim
Copy link

hello,

I've recently been working with DatasourceProxy to capture slow queries, and I noticed that there is an abstract query listener - I just need to override writeLog or onSlowQuery.

But when I registered MySlowQueryListner as an bean. I get an NPE at runtime. This is because the threshold timeunit required by Thread.schedule() is not configured by the ProxyDatasourceBuilderConfigurer.

So I solved this issue by injecting the datasource proxy property and setting the fields the same as any other SlowQueryListener. This issue asks for feedback on setting the required fields for user registered SlowQueryListener in the ProxyDatasourceBuilderConfigurer.

If this is in line with the direction of the project, can we make a PR for this?

@TaeTaeKim TaeTaeKim changed the title [DatasourceProxy] How about allowing to extending AbstractSlowQueryListener to make easily capture and customise operations on slow queries? [DatasourceProxy] How about allowing extending AbstractSlowQueryListener to make it easier to capture and customise actions for slow queries? Feb 2, 2025
@gavlyukovskiy
Copy link
Owner

If this is in line with the direction of the project, can we make a PR for this?

Feel free to open one!

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

No branches or pull requests

2 participants