@Retention(value=RUNTIME) @Target(value=METHOD) public @interface ExceptionMetered
\@ExceptionMetered(name = "fancyName", cause=IllegalArgumentException.class)
public String fancyName(String name) {
return "Sir Captain " + name;
}
A meter for the defining class with the name fancyName
will be created and each time the
#fancyName(String)
throws an exception of type cause
(or a subclass), the meter
will be marked.
A name for the metric can be specified as an annotation parameter, otherwise, the metric will be
named based on the method name.
For instance, given a declaration of
\@ExceptionMetered
public String fancyName(String name) {
return "Sir Captain " + name;
}
A meter named fancyName.exceptions
will be created and marked every time an exception is
thrown.Modifier and Type | Fields and Description |
---|---|
static String |
DEFAULT_NAME_SUFFIX
The default suffix for meter names.
|
public static final String DEFAULT_NAME_SUFFIX
public abstract String name
Copyright © 2014. All rights reserved.