FrankChen021 opened a new pull request #9919:
URL: https://github.com/apache/druid/pull/9919


   ### Description
   
   This PR solves #9917 .  In this PR, a class named as `SQLProfileLogger` is 
added to record execution time of sqls executed on metadata storage db to help 
analyze sql bottleneck.
   
   The reason why that class is added instead of using `SLF4JLog` provided in 
DBI is that the latter one records not only sql but also transaction/handle 
events which are not cared about currently.
   
   The logger will output logs as below: 
   ````
   2020-05-25T12:39:19,351 INFO [config-manager-0] 
org.apache.druid.metadata.SQLProfileLogger - statement:[SELECT payload FROM 
druid_config WHERE name = ?] took 0 millis
   2020-05-25T12:39:19,352 INFO [config-manager-0] 
org.apache.druid.metadata.SQLProfileLogger - statement:[SELECT payload FROM 
druid_config WHERE name = ?] took 0 millis
   2020-05-25T12:39:19,353 INFO [config-manager-0] 
org.apache.druid.metadata.SQLProfileLogger - statement:[SELECT payload FROM 
druid_config WHERE name = ?] took 0 millis
   2020-05-25T12:39:19,354 INFO [config-manager-0] 
org.apache.druid.metadata.SQLProfileLogger - statement:[SELECT payload FROM 
druid_config WHERE name = ?] took 0 millis
   
   ````
   
   <hr>
   
   This PR has:
   - [X] been self-reviewed.
   - [X] been tested in a test Druid cluster.
   
   <hr>
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to