All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yammer.metrics.annotation.Timed Maven / Gradle / Ivy

Go to download

Full deployment of default TransiStore service, using basic storage types, packaged as "fat jar" with its dependencies.

There is a newer version: 0.9.8
Show newest version
package com.yammer.metrics.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.concurrent.TimeUnit;

/**
 * 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 {@code fancyName} will be created and each time the * {@code #fancyName(String)} method is invoked, the method's execution will be timed. */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface Timed { /** * The group of the timer. */ String group() default ""; /** * The type of the timer. */ String type() default ""; /** * The name of the timer. */ String name() default ""; /** * The time unit of the timer's rate. */ TimeUnit rateUnit() default TimeUnit.SECONDS; /** * The time unit of the timer's duration. */ TimeUnit durationUnit() default TimeUnit.MILLISECONDS; }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy