When analyzing performance issues it is helpful to know which SQL queries have been executed and how log they took. The current mechanisms offered by Hibernate are inadequate for building custom tools.
* slow Slow query logging is not extensible, if you want to have access to the information you need to write a custom log appender and parse the log message, see [ https://discourse.hibernate.org/t/custom-sqlstatementlogger/3881 |https://discourse.hibernate.org/t/custom-sqlstatementlogger/3881]. * `StatementInspector` does not have access to the execution time . In our specific case we would like the generate a JFR event recording the query and it's its execution time. This can then be combined with other JFR events to find you which queries for executed for processing a single request, how often they were executed and how long their execution took. |
|