public static String absoluteMetricName(Class<?> clazz, String name) { return MetricRegistry.name(clazz, name); }
/** * Concatenates a class name and elements to form a dotted name, eliding any null values or * empty strings. * * @param klass the first element of the name * @param names the remaining elements of the name * @return {@code klass} and {@code names} concatenated by periods */ public static String name(Class<?> klass, String... names) { return name(klass.getName(), names); }
public static String absoluteMetricName(Class<?> clazz, String metric, String name) { return MetricRegistry.name(clazz.getPackage().getName() + "." + metric, name); } }
static String findName(final Class<?> declaring, final Member executable, final String annotationName, final boolean absolute, final String prefix) { if (annotationName == null || annotationName.isEmpty()) { if (absolute) { return executable.getName(); } return MetricRegistry.name(prefix(declaring, prefix), // bug in the JVM? Constructor.class.isInstance(executable) ? executable.getDeclaringClass().getSimpleName() : executable.getName()); } else if (absolute) { return annotationName; } return MetricRegistry.name(prefix(declaring, prefix), annotationName); }
Metadata meterMetadata = new Metadata(MetricRegistry.name(metricPrefix, "status", sc.toString()), sc + " responses on " + instrumentationName, "Number of responses with status code " + sc + " on " + instrumentationName, Metadata otherMetadata = new Metadata(MetricRegistry.name(metricPrefix, "status", "other"), "Other responses on " + instrumentationName, "Number of responses with other status codes on " + instrumentationName, this.otherMeter = metricsRegistry.meter(otherMetadata); Metadata timeoutsMetadata = new Metadata(MetricRegistry.name(metricPrefix, "timeouts"), "Timeouts on " + instrumentationName, "Number of timeouts on " + instrumentationName, this.timeoutsMeter = metricsRegistry.meter(timeoutsMetadata); Metadata errorsMetadata = new Metadata(MetricRegistry.name(metricPrefix, "errors"), "Errors on " + instrumentationName, "Number of errors on " + instrumentationName, Metadata activeRequestsMetadata = new Metadata(MetricRegistry.name(metricPrefix, "activeRequests"), "Active requests on " + instrumentationName, "Number of active requests on " + instrumentationName, Metadata timerMetadata = new Metadata(MetricRegistry.name(metricPrefix, "response"), instrumentationName + " response timer", "Response timer for " + instrumentationName,
final String name = MetricRegistry.name(injectionPoint.getMember().getDeclaringClass(), injectionPoint.getMember().getName()); final Metadata metadata = new Metadata(name, type); registrations.putIfAbsent(name, metadata);
finalName = MetricRegistry.name(member.getDeclaringClass(), memberName(member)); } else if (fromElement) { finalName = MetricRegistry.name(member.getDeclaringClass(), finalName); finalName = MetricRegistry.name((name.isEmpty()) ? bean.getSimpleName() : name, memberName(member)); if (!absolute) { finalName = MetricRegistry.name(bean.getPackage().getName(), finalName);