本文整理汇总了Java中org.eclipse.microprofile.metrics.annotation.Timed类的典型用法代码示例。如果您正苦于以下问题:Java Timed类的具体用法?Java Timed怎么用?Java Timed使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Timed类属于org.eclipse.microprofile.metrics.annotation包,在下文中一共展示了Timed类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addInterceptorBindings
import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
private void addInterceptorBindings(@Observes BeforeBeanDiscovery bbd, BeanManager manager) {
LOGGER.info("MicroProfile: Metrics activated");
declareAsInterceptorBinding(Counted.class, manager, bbd);
declareAsInterceptorBinding(Gauge.class, manager, bbd);
declareAsInterceptorBinding(Timed.class, manager, bbd);
declareAsInterceptorBinding(Metered.class, manager, bbd);
// It seems that fraction deployment module cannot be picked up as a CDI bean archive - see also SWARM-1725
bbd.addAnnotatedType(manager.createAnnotatedType(AMetricRegistryFactory.class));
bbd.addAnnotatedType(manager.createAnnotatedType(MetricNameFactory.class));
bbd.addAnnotatedType(manager.createAnnotatedType(MeteredInterceptor.class));
bbd.addAnnotatedType(manager.createAnnotatedType(CountedInterceptor.class));
bbd.addAnnotatedType(manager.createAnnotatedType(TimedInterceptor.class));
bbd.addAnnotatedType(manager.createAnnotatedType(MetricsInterceptor.class));
}
示例2: isMetricAbsolute
import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
private boolean isMetricAbsolute(Annotation annotation) {
/*
if (extension.getParameters().contains(MetricsParameter.useAbsoluteName)) { TODO
return true;
}
*/
if (Counted.class.isInstance(annotation)) {
return ((Counted) 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() + "]");
}
}
示例3: metricsMethod
import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
@Counted(name = "counter", monotonic = true)
@Gauge(name = "gauge", unit=MetricUnits.NONE)
@Metered(name = "meter")
@Timed(name = "timer")
public String metricsMethod() {
return "value";
}
示例4: metricName
import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
private String metricName(Annotation annotation) {
if (Counted.class.isInstance(annotation)) {
return ((Counted) annotation).name();
} else if (Gauge.class.isInstance(annotation)) {
return ((Gauge) annotation).name();
} else if (Metered.class.isInstance(annotation)) {
return ((Metered) annotation).name();
} else if (Timed.class.isInstance(annotation)) {
return ((Timed) annotation).name();
} else {
throw new IllegalArgumentException("Unsupported Metrics forMethod [" + annotation.getClass().getName() + "]");
}
}
示例5: cachedMethod
import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
@Timed(name = "calls")
public void cachedMethod(boolean hit) {
if (hit) {
hits.mark();
}
}
示例6: publicTimedMethod
import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
@Timed
public void publicTimedMethod() {
}
示例7: packagePrivateTimedMethod
import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
@Timed
void packagePrivateTimedMethod() {
}
示例8: protectedTimedMethod
import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
@Timed
protected void protectedTimedMethod() {
}
示例9: overloadedTimedMethod
import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
@Timed(name = "overloadedTimedMethodWithNoArguments")
public void overloadedTimedMethod() {
}
示例10: defaultNameTimedMethod
import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
@Timed
public void defaultNameTimedMethod() {
}
示例11: absoluteDefaultNameTimedMethod
import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
@Timed(absolute = true)
public void absoluteDefaultNameTimedMethod() {
}
示例12: MultipleMetricsConstructorBean
import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
@Counted(name = "counter", monotonic = true)
@Metered(name = "meter")
@Timed(name = "timer")
public MultipleMetricsConstructorBean() {
}
示例13: timedMethodOne
import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
@Timed
public void timedMethodOne() {
}
示例14: timedMethodTwo
import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
@Timed
public void timedMethodTwo() {
}
示例15: timedMethodProtected
import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
@Timed
protected void timedMethodProtected() {
}