Documentation / Annotations

Annotations

Quick links:

@Timed

When put on a class means that all public methods of that class will be enhanced with either a TimedMetric or BucketTimedMetric.

Example: Class level
package org.example.service;
  ...

  @Timed
  public class MyService {
    ...
  }

}
Example: with bucket ranges

Adding some bucket ranges (in milliseconds) means this method will use a BucketTimedMetric.

package org.example.service;
  ...

  @Timed(buckets={100,200})
  public class MyService {
    ...
  }

}

@NotTimed

Can be put on a class or method to explicitly exclude it from being enhanced by the agent.

Example: Class level
package org.example.service;
  ...

  @NotTimed
  public class MyService {
    ...
  }

}