diff --git a/pom.xml b/pom.xml index 06502a7c3d5e4023111f9c77f280315c5f73e5c3..947efbb02f791ceee8f27bfe0c99ce92db4a72ef 100644 --- a/pom.xml +++ b/pom.xml @@ -293,9 +293,9 @@ <version>1.5.12</version> </dependency> <dependency> - <groupId>org.stagemonitor</groupId> - <artifactId>stagemonitor-web</artifactId> - <version>0.31.0</version> + <groupId>com.codahale.metrics</groupId> + <artifactId>metrics-annotation</artifactId> + <version>3.0.2</version> </dependency> </dependencies> diff --git a/src/main/java/org/stagemonitor/core/metrics/MonitorGauges.java b/src/main/java/org/stagemonitor/core/metrics/MonitorGauges.java new file mode 100644 index 0000000000000000000000000000000000000000..8e0a25a74e0f899322288173063bca50ffbfadcb --- /dev/null +++ b/src/main/java/org/stagemonitor/core/metrics/MonitorGauges.java @@ -0,0 +1,25 @@ +package org.stagemonitor.core.metrics; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * When a type is marked with this annotation, the creation of gauges with + * @{@link com.codahale.metrics.annotation.Gauge} is activated for that type. + * + * <pre><code> + * \@MonitorGauges + * public class Queue { + * \@Gauge(name = "queueSize") + * public int getQueueSize() { + * return queue.size; + * } + * } + * </code></pre> + */ +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface MonitorGauges { +}