import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.perf4j.StopWatch;
import org.perf4j.slf4j.Slf4JStopWatch;

@Aspect
public class OrderProfileAspect{

    @Around("execution(* com.karl.controller..*.*(..)) || execution(* com.karl.service.impl..*.*(..)) || execution(* com.karl.dao..*.*(..))")
    public Object profile(ProceedingJoinPoint pjp) throws Throwable {
        String tagName = pjp.getSignature().getDeclaringType().getSimpleName() + "." + pjp.getSignature().getName();
        StopWatch stopWatch = new Slf4JStopWatch(tagName);
        Object retVal = pjp.proceed();
        stopWatch.stop();
        return retVal;
    }
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-26
  • 2021-07-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-21
  • 2021-08-28
  • 2022-12-23
  • 2021-07-19
  • 2022-12-23
相关资源
相似解决方案