@Inherited
@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface Counted
recordFailuresOnly()
to true
would instruct the corresponding aspect
to only record the failed attempts.
When the annotated method returns a CompletionStage
or any of its subclasses, the counters will be incremented
only when the CompletionStage
is completed. If completed exceptionally a failure is recorded, otherwise if
recordFailuresOnly()
is set to false
, a success is recorded.
CountedAspect
Modifier and Type | Optional Element and Description |
---|---|
java.lang.String |
description
An optional description for what the underlying counter is going to record.
|
java.lang.String[] |
extraTags
List of key-value pair arguments to supply the Counter as extra tags.
|
boolean |
recordFailuresOnly
By default, both failed and successful attempts are recorded.
|
java.lang.String |
value
Represents the metric name for the to-be-recorded counters.
|
public abstract java.lang.String value
public abstract boolean recordFailuresOnly
true
in
order to only record failed attempts.public abstract java.lang.String[] extraTags
Counter.Builder.tags(String...)