com.neeve.server.app.annotations
Annotation Type AppStat


@Retention(value=RUNTIME)
@Target(value={METHOD,FIELD})
@Inherited
public @interface AppStat

Annotates fields in the application that provide a statistic value that will be collected by the engine's statistics collector. This annotation may directly annotate the field or may annotate a method that returns the field. The value returned by the method may be of the following types:

Types other than those listed above are ignored.

If the field is discovered by a Talon Server during startup, the stat will be registered with the application's AepEngine, and will be included in the App's user stats in server heartbeats.

NOTE: The field instance is introspected just after the AepEngine is injected into the application, prior to the initialize method being called. The value of the field at that time must be non-null for the statistic to be registered. The annotated statistic instance cannot be changed after initialization.


Optional Element Summary
 boolean gauge
          When true the field or method is treated as returning a gauge value.
 String name
          When this App stat is annotating a field or method that is treated as a IStats.Gauge specifis the name of the gauge.
 

gauge

public abstract boolean gauge
When true the field or method is treated as returning a gauge value.

Note that annotating a method that returns a primitive value is not zero garbage because autoboxing occurs when the the method is invoked via reflection.

Returns:
True if the method of field should be wrapped and treated as a gauge.
Default:
true

name

public abstract String name
When this App stat is annotating a field or method that is treated as a IStats.Gauge specifis the name of the gauge.

Returns:
The name of the stat if this is Gauge stat.
Default:
""


Copyright © 2016 Neeve Research, LLC. All Rights Reserved.