@InterceptorBinding @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.
The annotated method/field must be of numeric type (extends Number).| Modifier and Type | Required Element and Description |
|---|---|
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.
|
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.
|
public abstract String unit
Metadata,
MetricUnitspublic abstract String name
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 String scope
MetricRegistry.APPLICATION_SCOPE.Copyright © 2017 – 2022 Eclipse Foundation. All rights reserved.
Use is subject to license terms.