Hi,

I think I saw somewhere on the documentation that we could get some
details on the SQL requests that get through by increasing the logging
level (debug, trace).
Unless I am mistaken, this is currently all there is to monitor what
is happening.

In our application, we have hidden important SQL-related APIs behind
intermediary APIs. These are located at a particular location in our
code which allows to add monitoring capabilities. This has proven to
be a real time saver and it had a huge impact in troubleshooting and
improving the performances of our code.

Let me explain:
We can add/remove a listener to a list of listeners at a central
location (this is thread safe).
When an SQL call is performed on our central API, a check is made on
our listener's list. If the list is empty, nothing special. Otherwise
the list is copied (to avoid mutation during processing) and events
are forged and sent to all listeners.

We can monitor the SQL statements that go through, the time taken to
execute. If it is a batch, we get all the calls. We get all the
parameters that were passed to PreparedStatements.
When there are listeners, we wrap the ResultSet in a custom one with
logging logic: we know the number of rows that were read, the number
of columns that were read, and the amount of time the result set was
kept open (parsing time).
The event is sent by the API making the call, so we know the call stack.

Any kinds of listeners can be implemented and added/removed at any
time: console output, scripts, GUI.

So, are there such capabilities in jOOQ that I overlooked? If not, are
there any plans on adding such API (possible due to jOOQ being a
centralised access)?

Cheers,
-Christopher

Reply via email to