org.apache.excalibur.instrument
Class ValueInstrument
java.lang.Object
org.apache.excalibur.instrument.AbstractInstrument
org.apache.excalibur.instrument.ValueInstrument
- All Implemented Interfaces:
- Instrument
public class ValueInstrument
- extends AbstractInstrument
Objects implementing Instrumentable can create Instruments with integer
values using a ValueInstrument. ValueInstruments are perfect for
profiling things like system memory, or the size of a pool or cache.
- Since:
- 4.1
- Version:
- CVS $Revision: 1.4 $ $Date: 2004/02/28 11:47:28 $
- Author:
- Avalon Development Team
Method Summary |
void |
setValue(int value)
Sets the current value of the Instrument. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ValueInstrument
public ValueInstrument(String name)
- Creates a new ValueInstrument.
- Parameters:
name
- The name of the Instrument. The value should be a string
which does not contain spaces or periods.
setValue
public void setValue(int value)
- Sets the current value of the Instrument. This method is optimized
to be extremely light weight when an InstrumentManager is not present
and there are no registered ValueInstrumentListeners.
Note that in many cases is best to call this method even if the
isActive() method returns false. This is because the InstrumentManager
will remember the last value set and use it if the instrument ever
becomes active. For things like pool sizes which do not change often,
this behavior is critical so that users can begin monitoring the value
and see what it was before they connected. Setting the value is
very light weight, but its calculation may not be. It is up to the
user to weigh the benefits and consequences one way or the other.
- Parameters:
value
- The new value for the Instrument.
Copyright © 1997-2012 Apache Software Foundation. All Rights Reserved.