org.apache.excalibur.instrument
Class CounterInstrument
java.lang.Object
org.apache.excalibur.instrument.AbstractInstrument
org.apache.excalibur.instrument.CounterInstrument
- All Implemented Interfaces:
- Instrument
public class CounterInstrument
- extends AbstractInstrument
CounterInstruments can be used to profile the number of times that
something happens. They are perfect for profiling things like the number
of times a class instance is created or destroyed. Or the number of
times that a method is accessed.
- Since:
- 4.1
- Version:
- CVS $Revision: 1.4 $ $Date: 2004/02/28 11:47:28 $
- Author:
- Avalon Development Team
Method Summary |
void |
increment()
Increments the Instrument. |
void |
increment(int count)
Increments the Instrument by a specified count. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CounterInstrument
public CounterInstrument(String name)
- Creates a new CounterInstrument.
- Parameters:
name
- The name of the Instrument. The value should be a string
which does not contain spaces or periods.
increment
public void increment()
- Increments the Instrument. This method is optimized to be extremely
light weight when an InstrumentManager is not present and there are no
registered CounterInstrumentListeners.
increment
public void increment(int count)
- Increments the Instrument by a specified count. This method is
optimized to be extremely light weight when an InstrumentManager is not
present and there are no registered CounterInstrumentListeners.
- Parameters:
count
- A positive integer to increment the counter by.
- Throws:
IllegalArgumentException
- If the count is not positive.
Copyright © 1997-2012 The Apache Software Foundation. All Rights Reserved.