/** * Increments the Instrument. This method is optimized to be extremely * light weight when an InstrumentManager is not present and there are no * registered CounterInstrumentListeners. */ public void increment() { InstrumentProxy proxy = getInstrumentProxy(); if( proxy != null ) { proxy.increment( 1 ); } }
/** * 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. * * @param count A positive integer to increment the counter by. * * @throws IllegalArgumentException If the count is not positive. */ public void increment( int count ) { // Check the count if( count <= 0 ) { throw new IllegalArgumentException( "Count must be a positive value." ); } InstrumentProxy proxy = getInstrumentProxy(); if( proxy != null ) { proxy.increment( count ); } } }