当前位置: 首页>>代码示例>>Java>>正文


Java Timed类代码示例

本文整理汇总了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));
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:18,代码来源:MetricCdiInjectionExtension.java

示例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() + "]");
        }
    }
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:20,代码来源:MetricResolver.java

示例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";
}
 
开发者ID:eclipse,项目名称:microprofile-metrics,代码行数:8,代码来源:MultipleMetricsMethodBean.java

示例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() + "]");
    }
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:14,代码来源:MetricResolver.java

示例5: cachedMethod

import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
@Timed(name = "calls")
public void cachedMethod(boolean hit) {
    if (hit) {
        hits.mark();
    }
}
 
开发者ID:eclipse,项目名称:microprofile-metrics,代码行数:7,代码来源:MetricProducerMethodBean.java

示例6: publicTimedMethod

import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
@Timed
public void publicTimedMethod() {
}
 
开发者ID:eclipse,项目名称:microprofile-metrics,代码行数:4,代码来源:VisibilityTimedMethodBean.java

示例7: packagePrivateTimedMethod

import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
@Timed
void packagePrivateTimedMethod() {
}
 
开发者ID:eclipse,项目名称:microprofile-metrics,代码行数:4,代码来源:VisibilityTimedMethodBean.java

示例8: protectedTimedMethod

import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
@Timed
protected void protectedTimedMethod() {
}
 
开发者ID:eclipse,项目名称:microprofile-metrics,代码行数:4,代码来源:VisibilityTimedMethodBean.java

示例9: overloadedTimedMethod

import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
@Timed(name = "overloadedTimedMethodWithNoArguments")
public void overloadedTimedMethod() {
}
 
开发者ID:eclipse,项目名称:microprofile-metrics,代码行数:4,代码来源:OverloadedTimedMethodBean.java

示例10: defaultNameTimedMethod

import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
@Timed
public void defaultNameTimedMethod() {
}
 
开发者ID:eclipse,项目名称:microprofile-metrics,代码行数:4,代码来源:DefaultNameMetricMethodBean.java

示例11: absoluteDefaultNameTimedMethod

import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
@Timed(absolute = true)
public void absoluteDefaultNameTimedMethod() {
}
 
开发者ID:eclipse,项目名称:microprofile-metrics,代码行数:4,代码来源:DefaultNameMetricMethodBean.java

示例12: MultipleMetricsConstructorBean

import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
@Counted(name = "counter", monotonic = true)
@Metered(name = "meter")
@Timed(name = "timer")
public MultipleMetricsConstructorBean() {
}
 
开发者ID:eclipse,项目名称:microprofile-metrics,代码行数:6,代码来源:MultipleMetricsConstructorBean.java

示例13: timedMethodOne

import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
@Timed
public void timedMethodOne() {
}
 
开发者ID:eclipse,项目名称:microprofile-metrics,代码行数:4,代码来源:InheritedTimedMethodBean.java

示例14: timedMethodTwo

import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
@Timed
public void timedMethodTwo() {
}
 
开发者ID:eclipse,项目名称:microprofile-metrics,代码行数:4,代码来源:InheritedTimedMethodBean.java

示例15: timedMethodProtected

import org.eclipse.microprofile.metrics.annotation.Timed; //导入依赖的package包/类
@Timed
protected void timedMethodProtected() {
}
 
开发者ID:eclipse,项目名称:microprofile-metrics,代码行数:4,代码来源:InheritedTimedMethodBean.java


注:本文中的org.eclipse.microprofile.metrics.annotation.Timed类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。