@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.Modifier and Type | Required Element and Description |
---|---|
java.lang.String |
unit
The unit of the gauge.
|
Modifier and Type | Optional Element and Description |
---|---|
boolean |
absolute
Denotes whether to use the absolute name or use the default given name relative to the annotated class.
|
java.lang.String |
description
The description of the gauge.
|
java.lang.String |
displayName
The human readable display name of the gauge.
|
java.lang.String |
name
The name of the gauge.
|
java.lang.String[] |
tags
The tags of the gauge.
|
public abstract java.lang.String unit
Metadata
,
MetricUnits
public abstract java.lang.String name
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