Skip to content

Annotations

brharrington edited this page Oct 27, 2016 · 10 revisions

@Monitor

Indicates a field or method should be collected for monitoring. The attributes annotated should be thread-safe for access by a background thread. If a method is annotated it should be inexpensive and avoid any potentially costly operations such as IO and networking. Expect that the fields will be polled frequently and cache values that require expensive computation rather than computing them inline.

Keys Type Description
name String A name for what you are monitoring.
description String A description of what the monitor does.
type Enum (DataSourceType) The type for the value. The three supported types are GAUGE, COUNTER, and INFORMATIONAL. All metrics should be either GAUGE or COUNTER, other non-numeric values that might be useful for debugging should be INFORMATIONAL. A gauge is a numeric value that can be sampled to get the current value. A counter is a non-decreasing numeric type that can be converted into a rate of change for a given period by comparing multiple samples.
@Monitor(name="UpdateCount", type= DataSourceType.COUNTER,
         description="Total number of update operations.")
protected final AtomicInteger updateCount = new AtomicInteger(0);

@MonitorTags

A method or field that is of the type TagList. This allows a set of tags to be specified dynamically when an instance is registered instead of only at compile time using the annotation.

@MonitorTags
private final TagList tags;