com.yammer.metrics.annotation
Annotation Type Timed


@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface Timed

An annotation for marking a method of a Guice-provided object as timed.

Given a method like this:


     \@Timed(name = "fancyName", rateUnit = TimeUnit.SECONDS, durationUnit =
 TimeUnit.MICROSECONDS)
     public String fancyName(String name) {
         return "Sir Captain " + name;
     }
 

A timer for the defining class with the name fancyName will be created and each time the #fancyName(String) method is invoked, the method's execution will be timed.


Optional Element Summary
 TimeUnit durationUnit
          The time unit of the timer's duration.
 String group
          The group of the timer.
 String name
          The name of the timer.
 TimeUnit rateUnit
          The time unit of the timer's rate.
 String type
          The type of the timer.
 

group

public abstract String group
The group of the timer.

Default:
""

type

public abstract String type
The type of the timer.

Default:
""

name

public abstract String name
The name of the timer.

Default:
""

rateUnit

public abstract TimeUnit rateUnit
The time unit of the timer's rate.

Default:
java.util.concurrent.TimeUnit.SECONDS

durationUnit

public abstract TimeUnit durationUnit
The time unit of the timer's duration.

Default:
java.util.concurrent.TimeUnit.MILLISECONDS


Copyright © 2012. All Rights Reserved.