public class PollingMonitoredValue<T> extends AbstractMonitorable<T>
Supplier
.Modifier and Type | Field and Description |
---|---|
protected T |
value |
Constructor and Description |
---|
PollingMonitoredValue(String name,
String description,
MonitorableRegistry registry,
int updateInterval,
com.google.common.base.Supplier<T> poller,
ValueSemantics semantics)
Creates a new
PollingMonitoredValue with the specified polling
interval. |
PollingMonitoredValue(String name,
String description,
MonitorableRegistry registry,
int updateInterval,
com.google.common.base.Supplier<T> poller,
ValueSemantics semantics,
javax.measure.Unit<?> unit)
Creates a new
PollingMonitoredValue with the specified polling
interval. |
PollingMonitoredValue(String name,
String description,
MonitorableRegistry registry,
int updateInterval,
com.google.common.base.Supplier<T> poller,
ValueSemantics semantics,
javax.measure.Unit<?> unit,
io.pcp.parfait.Scheduler scheduler)
Creates a new
PollingMonitoredValue with the specified polling
interval. |
Modifier and Type | Method and Description |
---|---|
T |
get()
This method should never block and must return as quickly as possible.
|
static <T> void |
poll(String name,
String description,
MonitorableRegistry registry,
int updateInterval,
com.google.common.base.Supplier<T> poller,
ValueSemantics semantics,
javax.measure.Unit<?> unit)
Convenient factory method to create pollers you don't care about keeping
– that is, pollers which should be registered and start updating their
value, but which you don't need to hold a reference to (because you will
presumably just be modifying the polled source).
|
void |
set(T newValue)
Sets the current value of this Monitorable.
|
attachMonitor, getDescription, getName, getSemantics, getType, getUnit, logValue, notifyMonitors, registerSelf, removeMonitor
public PollingMonitoredValue(String name, String description, MonitorableRegistry registry, int updateInterval, com.google.common.base.Supplier<T> poller, ValueSemantics semantics)
PollingMonitoredValue
with the specified polling
interval.updateInterval
- how frequently the Poller should be checked for updates (may
not be less than MIN_UPDATE_INTERVAL
public PollingMonitoredValue(String name, String description, MonitorableRegistry registry, int updateInterval, com.google.common.base.Supplier<T> poller, ValueSemantics semantics, javax.measure.Unit<?> unit)
PollingMonitoredValue
with the specified polling
interval.updateInterval
- how frequently the Poller should be checked for updates (may
not be less than MIN_UPDATE_INTERVAL
public PollingMonitoredValue(String name, String description, MonitorableRegistry registry, int updateInterval, com.google.common.base.Supplier<T> poller, ValueSemantics semantics, javax.measure.Unit<?> unit, io.pcp.parfait.Scheduler scheduler)
PollingMonitoredValue
with the specified polling
interval.updateInterval
- how frequently the Poller should be checked for updates (may
not be less than MIN_UPDATE_INTERVAL
public static <T> void poll(String name, String description, MonitorableRegistry registry, int updateInterval, com.google.common.base.Supplier<T> poller, ValueSemantics semantics, javax.measure.Unit<?> unit)
public T get()
Monitorable
public void set(T newValue)
Copyright © 2009–2019 Performance Co-Pilot. All rights reserved.