Package com.ryantenney.metrics.annotation

Examples of com.ryantenney.metrics.annotation.CachedGauge


  protected void withMethod(final Object bean, String beanName, Class<?> targetClass, final Method method) {
    if (method.getParameterTypes().length > 0) {
      throw new IllegalStateException("Method " + method.getName() + " is annotated with @CachedGauge but requires parameters.");
    }

    final CachedGauge annotation = method.getAnnotation(CachedGauge.class);
    final String metricName = Util.forCachedGauge(targetClass, method, annotation);

    metrics.register(metricName, new com.codahale.metrics.CachedGauge<Object>(annotation.timeout(), annotation.timeoutUnit()) {
      @Override
      protected Object loadValue() {
        return ReflectionUtils.invokeMethod(method, bean);
      }
    });
View Full Code Here

TOP

Related Classes of com.ryantenney.metrics.annotation.CachedGauge

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.