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

com.yammer.metrics.annotation.Metered 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 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 {@code fancyName} will be created and each time the * {@code #fancyName(String)} method is invoked, the meter will be marked. */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface Metered { /** * The group of the timer. */ String group() default ""; /** * The type of the timer. */ String type() default ""; /** * The name of the meter. */ String name() default ""; /** * The name of the type of events the meter is measuring. */ String eventType() default "calls"; /** * The time unit of the meter's rate. */ TimeUnit rateUnit() default TimeUnit.SECONDS; }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy