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

com.codahale.metrics.annotation.Metered Maven / Gradle / Ivy

The newest version!
package com.codahale.metrics.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * An annotation for marking a method of an annotated object as metered.
 * 

* Given a method like this: *


 *     {@literal @}Metered(name = "fancyName")
 *     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 name of the meter. */ String name() default ""; /** * If {@code true}, use the given name as an absolute name. If {@code false}, use the given name * relative to the annotated class. */ boolean absolute() default false; }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy