use of org.glassfish.jersey.server.model.ResourceMethod in project metrics by dropwizard.
the class InstrumentedResourceMethodApplicationListener method registerExceptionMeteredAnnotations.
private void registerExceptionMeteredAnnotations(final ResourceMethod method, final ExceptionMetered classLevelExceptionMetered) {
final Method definitionMethod = method.getInvocable().getDefinitionMethod();
if (classLevelExceptionMetered != null) {
exceptionMeters.putIfAbsent(definitionMethod, new ExceptionMeterMetric(metrics, method, classLevelExceptionMetered));
return;
}
final ExceptionMetered annotation = definitionMethod.getAnnotation(ExceptionMetered.class);
if (annotation != null) {
exceptionMeters.putIfAbsent(definitionMethod, new ExceptionMeterMetric(metrics, method, annotation));
}
}
use of org.glassfish.jersey.server.model.ResourceMethod in project metrics by dropwizard.
the class InstrumentedResourceMethodApplicationListener method chooseName.
protected static String chooseName(final String explicitName, final boolean absolute, final ResourceMethod method, final String... suffixes) {
final Method definitionMethod = method.getInvocable().getDefinitionMethod();
final String metricName;
if (explicitName != null && !explicitName.isEmpty()) {
metricName = absolute ? explicitName : name(definitionMethod.getDeclaringClass(), explicitName);
} else {
metricName = name(definitionMethod.getDeclaringClass(), definitionMethod.getName());
}
return name(metricName, suffixes);
}
use of org.glassfish.jersey.server.model.ResourceMethod in project metrics by dropwizard.
the class InstrumentedResourceMethodApplicationListener method registerMeteredAnnotations.
private void registerMeteredAnnotations(final ResourceMethod method, final Metered classLevelMetered) {
final Method definitionMethod = method.getInvocable().getDefinitionMethod();
if (classLevelMetered != null) {
meters.putIfAbsent(definitionMethod, meterMetric(metrics, method, classLevelMetered));
return;
}
final Metered annotation = definitionMethod.getAnnotation(Metered.class);
if (annotation != null) {
meters.putIfAbsent(definitionMethod, meterMetric(metrics, method, annotation));
}
}
use of org.glassfish.jersey.server.model.ResourceMethod in project metrics by dropwizard.
the class InstrumentedResourceMethodApplicationListener method chooseName.
protected static String chooseName(final String explicitName, final boolean absolute, final ResourceMethod method, final String... suffixes) {
final Method definitionMethod = method.getInvocable().getDefinitionMethod();
final String metricName;
if (explicitName != null && !explicitName.isEmpty()) {
metricName = absolute ? explicitName : name(definitionMethod.getDeclaringClass(), explicitName);
} else {
metricName = name(definitionMethod.getDeclaringClass(), definitionMethod.getName());
}
return name(metricName, suffixes);
}
use of org.glassfish.jersey.server.model.ResourceMethod in project metrics by dropwizard.
the class InstrumentedResourceMethodApplicationListener method registerTimedAnnotations.
private void registerTimedAnnotations(final ResourceMethod method, final Timed classLevelTimed) {
final Method definitionMethod = method.getInvocable().getDefinitionMethod();
if (classLevelTimed != null) {
registerTimers(method, definitionMethod, classLevelTimed);
return;
}
final Timed annotation = definitionMethod.getAnnotation(Timed.class);
if (annotation != null) {
registerTimers(method, definitionMethod, annotation);
}
}
Aggregations