Package com.codahale.metrics.annotation
Annotation Type ResponseMetered
@Inherited
@Documented
@Retention(RUNTIME)
@Target({TYPE,CONSTRUCTOR,METHOD,ANNOTATION_TYPE})
public @interface ResponseMetered
An annotation for marking a method of an annotated object as metered.
Given a method like this:
@ResponseMetered(name = "fancyName", level = ResponseMeteredLevel.ALL)
public String fancyName(String name) {
return "Sir Captain " + name;
}
Meters for the defining class with the name fancyName
will be created for response codes
based on the ResponseMeteredLevel selected. Each time the #fancyName(String)
method is invoked,
the appropriate response meter will be marked.
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionboolean
-
Element Details
-
name
String name- Returns:
- The name of the meter.
- Default:
- ""
-
absolute
boolean absolute- Returns:
- If
true
, use the given name as an absolute name. Iffalse
, use the given name relative to the annotated class. When annotating a class, this must befalse
.
- Default:
- false
-
level
ResponseMeteredLevel level- Returns:
- the ResponseMeteredLevel which decides which response code meters are marked.
- Default:
- COARSE
-