本文整理了Java中com.codahale.metrics.annotation.Gauge.absolute()
方法的一些代码示例,展示了Gauge.absolute()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Gauge.absolute()
方法的具体详情如下:
包路径:com.codahale.metrics.annotation.Gauge
类名称:Gauge
方法名:absolute
暂无
代码示例来源:origin: stagemonitor/stagemonitor
public static void monitorGauges(Object object) {
for (final Method method : object.getClass().getDeclaredMethods()) {
final Gauge gaugeAnnotation = method.getAnnotation(Gauge.class);
// only create gauge, if method takes no parameters and is non-void
if (gaugeAnnotation != null && methodTakesNoParamsAndIsNonVoid(method)) {
method.setAccessible(true);
final String signature = SignatureUtils.getSignature(object.getClass().getName(), method.getName(),
gaugeAnnotation.name(), gaugeAnnotation.absolute());
registerGauge(object, method, signature);
}
}
}
代码示例来源:origin: ryantenney/metrics-spring
static String forGauge(Class<?> klass, Member member, Gauge annotation) {
return chooseName(annotation.name(), annotation.absolute(), klass, member);
}
代码示例来源:origin: palominolabs/metrics-guice
@Nonnull
@Override
public String getNameForGauge(@Nonnull Class<?> instanceClass, @Nonnull Method method, @Nonnull Gauge gauge) {
if (gauge.absolute()) {
return gauge.name();
}
if (gauge.name().isEmpty()) {
return name(instanceClass, method.getName(), GAUGE_SUFFIX);
}
return name(instanceClass, gauge.name());
}
}
代码示例来源:origin: com.palominolabs.metrics/metrics-guice
@Nonnull
@Override
public String getNameForGauge(@Nonnull Method method, @Nonnull Gauge gauge) {
if (gauge.absolute()) {
return gauge.name();
}
if (gauge.name().isEmpty()) {
return name(method.getDeclaringClass(), method.getName(), GAUGE_SUFFIX);
}
return name(method.getDeclaringClass(), gauge.name());
}
代码示例来源:origin: palominolabs/metrics-guice
@Nonnull
@Override
public String getNameForGauge(@Nonnull Class<?> instanceClass, @Nonnull Method method, @Nonnull Gauge gauge) {
if (gauge.absolute()) {
return gauge.name();
}
if (gauge.name().isEmpty()) {
return name(method.getDeclaringClass(), method.getName(), GAUGE_SUFFIX);
}
return name(method.getDeclaringClass(), gauge.name());
}
代码示例来源:origin: org.sonatype.goodies.dropwizard/dropwizard-support-core
@Nonnull
@Override
public String getNameForGauge(@Nonnull final Class<?> instanceClass,
@Nonnull final Method method,
@Nonnull final Gauge gauge)
{
if (gauge.absolute()) {
return gauge.name();
}
else {
return metricName(method, gauge.name());
}
}
代码示例来源:origin: astefanutti/metrics-cdi
private boolean isMetricAbsolute(Annotation annotation) {
if (extension.<Boolean>getParameter(UseAbsoluteName).orElse(false))
return true;
if (CachedGauge.class.isInstance(annotation))
return ((CachedGauge) annotation).absolute();
else if (Counted.class.isInstance(annotation))
return ((Counted) annotation).absolute();
else if (ExceptionMetered.class.isInstance(annotation))
return ((ExceptionMetered) annotation).absolute();
else if (Gauge.class.isInstance(annotation))
return ((Gauge) annotation).absolute();
else if (Metered.class.isInstance(annotation))
return ((Metered) annotation).absolute();
else if (Timed.class.isInstance(annotation))
return ((Timed) annotation).absolute();
else
throw new IllegalArgumentException("Unsupported Metrics forMethod [" + annotation.getClass().getName() + "]");
}
代码示例来源:origin: io.astefanutti.metrics.cdi/metrics-cdi
private boolean isMetricAbsolute(Annotation annotation) {
if (extension.<Boolean>getParameter(UseAbsoluteName).orElse(false))
return true;
if (CachedGauge.class.isInstance(annotation))
return ((CachedGauge) annotation).absolute();
else if (Counted.class.isInstance(annotation))
return ((Counted) annotation).absolute();
else if (ExceptionMetered.class.isInstance(annotation))
return ((ExceptionMetered) annotation).absolute();
else if (Gauge.class.isInstance(annotation))
return ((Gauge) annotation).absolute();
else if (Metered.class.isInstance(annotation))
return ((Metered) annotation).absolute();
else if (Timed.class.isInstance(annotation))
return ((Timed) annotation).absolute();
else
throw new IllegalArgumentException("Unsupported Metrics forMethod [" + annotation.getClass().getName() + "]");
}
内容来源于网络,如有侵权,请联系作者删除!