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:
@Gauge(name = "queueSize") public int getQueueSize() { return queue.size; }
queueSize
will be created which uses the annotated method's return value as its value. The annotated method/field must be of numeric type (extendsNumber
).
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description boolean
absolute
Denotes whether to use the absolute name or use the default given name relative to the annotated class.String
description
The description of the gauge.String
name
The name of the gauge.String
scope
The scope that this gauge belongs to.String[]
tags
The tags of the gauge.
-
-
-
Element Detail
-
unit
String unit
The unit of the gauge.- Returns:
- (Required) The unit of the gauge.
- See Also:
Metadata
,MetricUnits
-
-
-
name
String name
The name of the gauge.- Returns:
- The name of the gauge.
- Default:
- ""
-
-
-
scope
String scope
The scope that this gauge belongs to.- Returns:
- The scope this gauge belongs to. By default, the value is
MetricRegistry.APPLICATION_SCOPE
.
- Default:
- "application"
-
-