com.yammer.metrics.annotation.Gauge Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of metrics-annotation Show documentation
Show all versions of metrics-annotation Show documentation
A dependency-less package of just the annotations used by other Metrics modules.
package com.yammer.metrics.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* An annotation for marking a method of a Guice-provided object as a gauge.
*
* Given a method like this:
*
* \@Gauge(name = "queueSize")
* public int getQueueSize() {
* return queue.size;
* }
*
*
* A gauge for the defining class with the name {@code queueSize} will be created which uses the
* annotated method's return value as its value.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Gauge {
/**
* The gauge's name.
*/
String name() default "";
}