public class MonitoredValue<T> extends AbstractMonitorable<T>
Monitorable
for free-running values that are updatable through a single set method call.
A free-running value is a value that increments and decrements at-will over time. This is essentially a "point in time" measurement. An example of an instantaneous value is the number of active HTTP sessions.
It is recommended that monotonically-increasing counters be implemented using
the class MonitoredCounter
in preference to this class.
Modifier and Type | Field and Description |
---|---|
protected T |
value |
LOG
Constructor and Description |
---|
MonitoredValue(String name,
String description,
MonitorableRegistry registry,
T initialValue) |
MonitoredValue(String name,
String description,
MonitorableRegistry registry,
T initialValue,
javax.measure.Unit<?> unit) |
MonitoredValue(String name,
String description,
T initialValue) |
MonitoredValue(String name,
String description,
T initialValue,
javax.measure.Unit<?> unit) |
Modifier and Type | Method and Description |
---|---|
T |
get()
This method should never block and must return as quickly as possible.
|
void |
set(T newValue)
Sets the current value of this Monitorable.
|
attachMonitor, getDescription, getName, getSemantics, getType, getUnit, logValue, notifyMonitors, registerSelf, removeMonitor
public MonitoredValue(String name, String description, T initialValue, javax.measure.Unit<?> unit)
public MonitoredValue(String name, String description, MonitorableRegistry registry, T initialValue)
public MonitoredValue(String name, String description, MonitorableRegistry registry, T initialValue, javax.measure.Unit<?> unit)
public T get()
Monitorable
public void set(T newValue)
Copyright © 2009–2018 Performance Co-Pilot. All rights reserved.