static final String COUNTER_SUFFIX = "counter";
static final String COUNTER_SUFFIX_MONOTONIC = "current";
@Nullable
static MethodInterceptor forMethod(MetricRegistry metricRegistry, Class<?> klass, Method method) {
final Counted annotation = method.getAnnotation(Counted.class);
if (annotation != null) {
final Counter counter = metricRegistry.counter(determineName(annotation, klass, method));
return new CountedInterceptor(counter, annotation);
}
return null;