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; }queueSizewill 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 booleanabsoluteDenotes whether to use the absolute name or use the default given name relative to the annotated class.StringdescriptionThe description of the gauge.StringnameThe name of the gauge.StringscopeThe scope that this gauge belongs to.String[]tagsThe 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"
-
-