class MeanValueInstrumentSample extends AbstractValueInstrumentSample
| Modifier and Type | Field and Description |
|---|---|
private long |
m_valueTotal
Total of all values seen during the sample period.
|
m_lastValue, m_value, m_valueCountm_time| Constructor and Description |
|---|
MeanValueInstrumentSample(InstrumentProxy instrumentProxy,
java.lang.String name,
long interval,
int size,
java.lang.String description,
long lease)
Creates a new MeanValueInstrumentSample
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
advanceToNextSample(boolean reset)
The current sample has already been stored.
|
int |
getType()
Returns the type of the Instrument Sample.
|
protected void |
loadState(int value,
org.apache.avalon.framework.configuration.Configuration state)
Used to load the state, called from AbstractInstrumentSample.loadState();
|
protected void |
setValueInner(int value,
long time)
Sets the current value of the sample.
|
protected void |
writeStateAttributes(java.io.PrintWriter out)
Allow subclasses to add information into the saved state.
|
getFillValue, getInstrumentType, getValueInner, setValueaddInstrumentSampleListener, expire, extendLease, getDescription, getDescriptor, getInstrumentProxy, getInterval, getLeaseExpirationTime, getName, getSize, getSnapshot, getStateVersion, getTime, getValue, isConfigured, loadState, makePermanent, removeInstrumentSampleListener, setConfigured, stateChanged, toString, update, updateListeners, writeStateenableLogging, getLogger, setupLogger, setupLogger, setupLoggerprivate long m_valueTotal
MeanValueInstrumentSample(InstrumentProxy instrumentProxy, java.lang.String name, long interval, int size, java.lang.String description, long lease)
instrumentProxy - The InstrumentProxy which owns the
InstrumentSample.name - The name of the new InstrumentSample.interval - The sample interval of the new InstrumentSample.size - The number of samples to store as history. Assumes that size is at least 1.description - The description of the new InstrumentSample.lease - The length of the lease in milliseconds.public int getType()
protected void advanceToNextSample(boolean reset)
Should only be called when synchronized.
advanceToNextSample in class AbstractValueInstrumentSamplereset - True if the next sample should be reset.protected void writeStateAttributes(java.io.PrintWriter out)
writeStateAttributes in class AbstractValueInstrumentSampleout - PrintWriter to write to.protected void loadState(int value,
org.apache.avalon.framework.configuration.Configuration state)
throws org.apache.avalon.framework.configuration.ConfigurationException
Should only be called when synchronized.
loadState in class AbstractValueInstrumentSamplevalue - Current value loaded from the state.state - Configuration object to load state from.org.apache.avalon.framework.configuration.ConfigurationException - If there were any problems loading the
state.protected void setValueInner(int value,
long time)
setValueInner in class AbstractValueInstrumentSamplevalue - New sample value.time - Time that the new sample arrives.