Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

Image Added

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.

Image Added

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.

Image Added


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

Image Added