com.hazelcast.internal.metrics
Annotation Type Probe


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

Annotation that can be placed on a field or method of an object to indicate that it should be tracked by the MetricsRegistry when the MetricsRegistry.scanAndRegister(Object, String) is called. The MetricsRegistry will automatically scan all interfaces and super classes of an object (recursively). So it is possible to define a Gauge on e.g. an interface or abstract class.

Prefer field

Prefer placing a Gauge to a field above a method if the type is a primitive. The Field provides access to the actual field without the need for autoboxing. With the Method a wrapper object is created when a primitive is returned by the method. Therefor fields produce less garbage than methods. A Gauge can be placed on field or methods with the following (return) type:
  1. byte
  2. short
  3. int
  4. float
  5. long
  6. double
  7. AtomicInteger
  8. AtomicLong
  9. Counter
  10. Byte
  11. Short
  12. Integer
  13. Float
  14. Double
  15. Collection: it will return the size
  16. Map: it will return the size
If the field or method points to a null reference, it is interpreted as 0.


Optional Element Summary
 String name
          The name of the gauge.
 

name

public abstract String name
The name of the gauge. By default the name of the field or method is used.

Returns:
the name of the gauge.
Default:
""


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.