path: util/aop/aop-dao/src/main/java/com/knubisoft/aop/dao/SlowSqlQueryExecutionAspect.java

SlowSqlQueryExecutionAspect has the same behavior as SlowHttpRequestProcessingAspect and SlowServiceExecutionAspect only difference is that it counts SQL query execution time.

SlowSqlQueryExecutionAspect annotated with @ConditionalOnExpression("${aop.dao.enabled:true}"), so to 'enable' this aspect you must set the property aop.dao.enabled within the application.yaml to true.

Also, you have to set a duration value in the delaysTracking section within the application.yaml, property delaysTracking.dao-duration acts like a threshold from which the aspect is based when deciding if an SQL query execution is slow.


If the execution time exceeds the threshold, the aspect logs the details and notifies the developer that a slow SQL query execution is detected.


  • No labels