@Retention(value=RUNTIME)
@Target(value={METHOD,ANNOTATION_TYPE})
public @interface Gauge
Given a method annotated with @Gauge like this:
@Gauge(name = "queueSize")
public int getQueueSize() {
return queue.size;
}
A gauge with the fully qualified class name + queueSize
will be created which uses the
annotated method's return value as its value.
Given a field annotated with @Gauge like this:
@Gauge
long value;
A gauge with the fully qualified class name + value
will be created which uses the
annotated field value as its value.Modifier and Type | Required Element and Description |
---|---|
java.lang.String |
unit |
Modifier and Type | Optional Element and Description |
---|---|
boolean |
absolute |
java.lang.String |
description |
java.lang.String |
displayName |
java.lang.String |
name |
java.lang.String[] |
tags |
public abstract java.lang.String unit
Metadata
,
MetricUnits
public abstract java.lang.String[] tags
String
tag must be in the form of 'key=value'. If the input is empty or does
not contain a '=' sign, the entry is ignored.Metadata
public abstract boolean absolute
true
, use the given name as an absolute name. If false
(default), use the given name
relative to the annotated class.public abstract java.lang.String displayName
Metadata
public abstract java.lang.String description
Metadata