@Override
public Object invoke(MethodInvocation methodInvocation) throws Throwable {
EnableMetricCounter annotation = methodInvocation.getThis().getClass().getAnnotation(EnableMetricCounter.class);
String name = StringUtils.isBlank(annotation.value())
? methodInvocation.getThis().getClass().getName() + "." + methodInvocation.getMethod().getName()
: annotation.value();
Counter counter = Jboot.me().getMetric().counter(name);
try {
counter.inc();
return methodInvocation.proceed();
} finally {
counter.dec();
}
}
JbootMetricConterAopInterceptor.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:jboot
作者:
评论列表
文章目录