Annotation Type Metric
-
@Retention(RUNTIME) @Target({FIELD,PARAMETER,ANNOTATION_TYPE}) public @interface Metric
An annotation requesting that a metric be injected or registered. The metric will be registered in the application MetricRegistry. Given an injected field annotated with @Metric like this:@Inject @Metric(name="histogram") public Histogram histogram;
This may also be used to register a metric.
-
-
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 metric.String
name
The name of the metric.String
scope
The scope that this metric belongs to.String[]
tags
The tags of the metric.String
unit
The unit of the metric.
-
-
-
Element Detail
-
name
String name
The name of the metric.- Returns:
- The name of the metric.
- Default:
- ""
-
-
-
unit
String unit
The unit of the metric.- Returns:
- The unit of the metric. By default, the value is
MetricUnits.NONE
. - See Also:
Metadata
,MetricUnits
- Default:
- "none"
-
-
-
scope
String scope
The scope that this metric belongs to.- Returns:
- The scope this metric belongs to. By default, the value is
MetricRegistry.APPLICATION_SCOPE
.
- Default:
- "application"
-
-