com.yammer.metrics.annotation
Annotation Type Metered


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

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

Given a method like this:


     \@Metered(name = "fancyName", eventType = "namings", rateUnit = TimeUnit.SECONDS)
     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) method is invoked, the meter will be marked.


Optional Element Summary
 String eventType
          The name of the type of events the meter is measuring.
 String group
          The group of the timer.
 String name
          The name of the meter.
 TimeUnit rateUnit
          The time unit of the meter'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 meter.

Default:
""

eventType

public abstract String eventType
The name of the type of events the meter is measuring.

Default:
"calls"

rateUnit

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

Default:
java.util.concurrent.TimeUnit.SECONDS


Copyright © 2012. All Rights Reserved.