You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

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

MethodCallsCountAspect works on the service layer and collects metrics about how many times each public method has been called.

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

MethodCallsCountAspect annotated with @ConditionalOnProperty(value = "management.serviceLayerMetrics.methodCallsCountEnabled", havingValue = "true"), so to 'enable' this aspect you must set the property management.serviceLayerMetrics.methodCallsCountEnabled within the application.yaml to true.



  • No labels