Annotation Type Gauge
-
@InterceptorBinding @Retention(RUNTIME) @Target({METHOD,ANNOTATION_TYPE}) public @interface Gauge
An annotation for marking a method or field as a gauge. The metric will be registered in the application MetricRegistry.Given a method annotated with @Gauge like this:
A gauge with the fully qualified class name +@Gauge(name = "queueSize") public int getQueueSize() { return queue.size; }
queueSize
will be created which uses the annotated method's return value as its value.Given a field annotated with @Gauge like this:
A gauge with the fully qualified class name +@Gauge long value;
value
will be created which uses the annotated field value as its value.
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.String
unit
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description boolean
absolute
java.lang.String
description
java.lang.String
displayName
java.lang.String
name
java.lang.String[]
tags
-
-
-
Element Detail
-
unit
java.lang.String unit
- Returns:
- (Required) The unit of the gauge.
- See Also:
Metadata
,MetricUnits
-
-
-
tags
java.lang.String[] tags
- Returns:
- The tags of the gauge. Each
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. - See Also:
Metadata
- Default:
- {}
-
-
-
displayName
java.lang.String displayName
- Returns:
- The display name of the gauge.
- See Also:
Metadata
- Default:
- ""
-
-
-
description
java.lang.String description
- Returns:
- The description of the gauge.
- See Also:
Metadata
- Default:
- ""
-
-