protected void didInvokeUnit ( Unit unit , long start ) { // track some performance metrics if ( PERF_TRACK ) { long duration = System . currentTimeMillis ( ) - start ; Object key = unit . getClass ( ) ; recordMetrics ( key , duration ) ; // report long runners long thresh = unit . getLongThreshold ( ) ; if ( thresh == 0 ) { thresh = _longThreshold ; } if ( duration > thresh ) { StringBuilder msg = new StringBuilder ( ) ; msg . append ( ( duration >= 10 * thresh ) ? "Really long" : "Long" ) ; msg . append ( " invoker unit [unit=" ) . append ( unit ) ; msg . append ( " (" ) . append ( key ) . append ( "), time=" ) . append ( duration ) . append ( "ms" ) ; if ( unit . getDetail ( ) != null ) { msg . append ( ", detail=" ) . append ( unit . getDetail ( ) ) ; } log . warning ( msg . append ( "]." ) . toString ( ) ) ; } } }
Called before we process an invoker unit .