@Target(value={TYPE,METHOD}) @Retention(value=RUNTIME) public @interface Timed
When put on a Class the default is that all public methods on that Class are timed.
When put on a method we want to override some of metric naming or only collect timed execution on very few methods on the class.
| Modifier and Type | Optional Element and Description |
|---|---|
int[] |
buckets
Define buckets as a list of millisecond times.
|
String |
fullName
Set the full name of the metric.
|
String |
name
Set the method name part of the full metric name.
|
String |
prefix
Set the prefix for short metric names.
|
public abstract String name
This is used when the method name is not appropriate or when there is method overloading and the otherwise generated unique name is unclear.
The package and class names are still used and prepended to this name value.
public abstract int[] buckets
For example with values of 100, 200, 300 there a with 4 bucket ranges of:
0 to 100 milliseconds
100 to 200 milliseconds
200 to 300 milliseconds
300+ milliseconds
Defining buckets means a BucketTimedMetric will be used instead of a TimedMetric.
Copyright © 2018. All rights reserved.