RouteTransformer transformer = new MetricsTransformer(metricRegistry); application.addRouteTransformer(transformer);
log.debug("Found '{}' annotation on method '{}'", Metered.class.getSimpleName(), LangUtils.toString(method)); Metered metered = method.getAnnotation(Metered.class); String metricName = !metered.value().isEmpty() ? metered.value() : getMetricName(route, method); handler = new MeteredHandler(metricName, metricRegistry, route.getRouteHandler()); } else if (method.isAnnotationPresent(Timed.class)) { log.debug("Found '{}' annotation on method '{}'", Timed.class.getSimpleName(), LangUtils.toString(method)); Timed timed = method.getAnnotation(Timed.class); String metricName = !timed.value().isEmpty() ? timed.value() : getMetricName(route, method); handler = new TimedHandler(metricName, metricRegistry, route.getRouteHandler()); } else if (method.isAnnotationPresent(Counted.class)) { log.debug("Found '{}' annotation on method '{}'", Counted.class.getSimpleName(), LangUtils.toString(method)); Counted counted = method.getAnnotation(Counted.class); String metricName = !counted.value().isEmpty() ? counted.value() : getMetricName(route, method); handler = new CountedHandler(metricName, counted.active(), metricRegistry, route.getRouteHandler());
log.debug("Found '{}' annotation on method '{}'", Metered.class.getSimpleName(), LangUtils.toString(method)); Metered metered = method.getAnnotation(Metered.class); String metricName = !metered.value().isEmpty() ? metered.value() : getMetricName(route, method); handler = new MeteredHandler(metricName, metricRegistry, route.getRouteHandler()); } else if (method.isAnnotationPresent(Timed.class)) { log.debug("Found '{}' annotation on method '{}'", Timed.class.getSimpleName(), LangUtils.toString(method)); Timed timed = method.getAnnotation(Timed.class); String metricName = !timed.value().isEmpty() ? timed.value() : getMetricName(route, method); handler = new TimedHandler(metricName, metricRegistry, route.getRouteHandler()); } else if (method.isAnnotationPresent(Counted.class)) { log.debug("Found '{}' annotation on method '{}'", Counted.class.getSimpleName(), LangUtils.toString(method)); Counted counted = method.getAnnotation(Counted.class); String metricName = !counted.value().isEmpty() ? counted.value() : getMetricName(route, method); handler = new CountedHandler(metricName, counted.active(), metricRegistry, route.getRouteHandler());
RouteTransformer transformer = new MetricsTransformer(metricRegistry); application.addRouteTransformer(transformer);