public class StatusAggregator extends Object implements KeyValueStatusListener
It will keep at least the last value of each status data it is configured to monitor.
It can also keep a history during a given time, and accumulate statistics over a given time.
| Modifier and Type | Class and Description |
|---|---|
static class |
StatusAggregator.Statistics |
static class |
StatusAggregator.TimedValue |
| Constructor and Description |
|---|
StatusAggregator() |
| Modifier and Type | Method and Description |
|---|---|
void |
clearAggregate(String key)
stop monitoring a given data.
|
Map<String,Object> |
getAllLast() |
Map<String,StatusAggregator.TimedValue> |
getAllLastTV() |
Map<String,StatusAggregator.Statistics> |
getAllStatistics() |
double |
getAverage(String key)
returns the average (over the configured duration) for a given key.
|
protected org.lsst.ccs.bus.StatusAggregator.StatusAggregateConfig |
getConfig(String key) |
List<StatusAggregator.TimedValue> |
getHistory(String key)
returns the history (over the configured duration) for a given key.
|
Object |
getLast(String key)
returns the last value seen for a given key (which has to be monitored)
|
StatusAggregator.TimedValue |
getLastTV(String key) |
double |
getMax(String key)
returns the max (over the configured duration) for a given key.
|
double |
getMin(String key)
returns the min (over the configured duration) for a given key.
|
StatusAggregator.Statistics |
getStatistics(String key) |
double |
getStdDev(String key)
returns the stddev (over the configured duration) for a given key.
|
void |
onKeyValueStatusDecomposition(String source,
long timeStamp,
String key,
Object value,
int commonID)
listeners will receive a EncodedDataStatus split along key-values (values being of a simple type)
|
void |
setAggregate(String key,
int historyDuration,
int aggregateWindow)
Configures the StatusAgregator to monitor a given data.
|
void |
setAggregatePattern(Pattern pattern,
int historyDuration,
int aggregateWindow) |
void |
setAggregatePattern(String pattern,
int historyDuration,
int aggregateWindow) |
public void setAggregate(String key, int historyDuration, int aggregateWindow)
key - the name ("subsystem/key") of the data to be monitoredhistoryDuration - duration (in ms) for which to keep history. -1 not to keep
history.aggregateWindow - duration (in ms) for which to compute aggregates and stats. -1
not to compute.public void setAggregatePattern(String pattern, int historyDuration, int aggregateWindow)
public void setAggregatePattern(Pattern pattern, int historyDuration, int aggregateWindow)
public void clearAggregate(String key)
key - the name ("subsystem/key") of the data to be clearedprotected org.lsst.ccs.bus.StatusAggregator.StatusAggregateConfig getConfig(String key)
public void onKeyValueStatusDecomposition(String source, long timeStamp, String key, Object value, int commonID)
KeyValueStatusListeneronKeyValueStatusDecomposition in interface KeyValueStatusListenercommonID - calls having the same "commonID" are extracted from the same Encoded object.public Object getLast(String key)
key - public StatusAggregator.TimedValue getLastTV(String key)
public double getAverage(String key)
key - public double getStdDev(String key)
key - public double getMin(String key)
key - public double getMax(String key)
key - public List<StatusAggregator.TimedValue> getHistory(String key)
key - public StatusAggregator.Statistics getStatistics(String key)
public Map<String,StatusAggregator.TimedValue> getAllLastTV()
public Map<String,StatusAggregator.Statistics> getAllStatistics()
Copyright © 2014 LSST. All rights reserved.