public void addValue ( long newValue ) { // keep a "total" timer for all values InApplicationMonitor . getInstance ( ) . addTimerMeasurement ( timerName , newValue ) ; // keep track of the current maximum value if ( newValue > currentMaxValue ) { currentMaxValue = newValue ; } // select the bin to put this value in long binIndex ; if ( newValue > maxLimit ) { binIndex = maxLimit / factor ; } else { binIndex = newValue / factor ; } // add the new value to the appropriate bin String binName = getBinName ( binIndex ) ; InApplicationMonitor . getInstance ( ) . incrementCounter ( binName ) ; }
adds a new value to the InApplicationMonitor grouping it into the appropriate bin .