|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.excalibur.instrument.manager.impl.AbstractInstrumentSample
org.apache.excalibur.instrument.manager.impl.CounterInstrumentSample
class CounterInstrumentSample
A InstrumentSample which stores the number of times that increment has been called during the sample period.
Field Summary | |
---|---|
protected int |
m_count
The count. |
Fields inherited from class org.apache.excalibur.instrument.manager.impl.AbstractInstrumentSample |
---|
m_time |
Constructor Summary | |
---|---|
CounterInstrumentSample(InstrumentProxy instrumentProxy,
java.lang.String name,
long interval,
int size,
java.lang.String description,
long lease)
Creates a new CounterInstrumentSample |
Method Summary | |
---|---|
protected void |
advanceToNextSample(boolean reset)
The current sample has already been stored. |
protected int |
getFillValue()
Returns the value to use for filling in the buffer when time is skipped. |
int |
getInstrumentType()
Returns the Type of the Instrument which can use the sample. |
int |
getType()
Returns the type of the Instrument Sample. |
int |
getValueInner()
Obtain the value of the sample. |
private void |
increment(int count,
long time)
Increments the count. |
void |
increment(java.lang.String instrumentName,
int count,
long time)
Called by a CounterInstrument whenever its value is incremented. |
protected void |
loadState(int value,
org.apache.avalon.framework.configuration.Configuration state)
Used to load the state, called from AbstractInstrumentSample.loadState(); |
Methods inherited from class org.apache.excalibur.instrument.manager.impl.AbstractInstrumentSample |
---|
addInstrumentSampleListener, expire, extendLease, getDescription, getDescriptor, getInstrumentProxy, getInterval, getLeaseExpirationTime, getName, getSize, getSnapshot, getStateVersion, getTime, getValue, isConfigured, loadState, makePermanent, removeInstrumentSampleListener, setConfigured, stateChanged, toString, update, updateListeners, writeState, writeStateAttributes |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.avalon.framework.logger.LogEnabled |
---|
enableLogging |
Field Detail |
---|
protected int m_count
Constructor Detail |
---|
CounterInstrumentSample(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.Method Detail |
---|
public int getType()
getType
in interface InstrumentSample
public final int getInstrumentType()
This InstrumentSample returns DefaultInstrumentManager.INSTRUMENT_TYPE_COUNTER
getInstrumentType
in interface InstrumentSample
public int getValueInner()
getValueInner
in class AbstractInstrumentSample
protected void advanceToNextSample(boolean reset)
Should only be called when synchronized.
advanceToNextSample
in class AbstractInstrumentSample
reset
- True if the next sample should be reset.protected int getFillValue()
Should only be called when synchronized.
getFillValue
in class AbstractInstrumentSample
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 AbstractInstrumentSample
value
- 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.public void increment(java.lang.String instrumentName, int count, long time)
increment
in interface org.apache.excalibur.instrument.manager.CounterInstrumentListener
instrumentName
- The name of Instrument which was incremented.count
- A positive integer to increment the counter by.time
- The time that the Instrument was incremented.private void increment(int count, long time)
time
- Time that the count is incremented.count
- A positive integer to increment the counter by.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |