Versions Compared

Key

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

path: util/aop/aop-service/src/main/java/com/knubisoft/aop/service/MethodExecutionTimeAspect.java

MethodExecutionTimeAspect works on the service layer and collects metrics about how long it took to execute and process the business logic of a particular method for each of its invocations.

For counting we use the Micrometer library and its Timer, for each method, the first time it is called, a Timer is created using the TimerFactory and performs execution time count, if the Timer for method already exists, TimerFactory will return an existing instead of creating a new one.