private Object doMoskitoProfiling ( ProceedingJoinPoint pjp , String statement ) throws Throwable { String statementGeneralized = removeParametersFromStatement ( statement ) ; long callTime = System . nanoTime ( ) ; QueryStats cumulatedStats = producer . getDefaultStats ( ) ; QueryStats statementStats = null ; try { statementStats = producer . getStats ( statementGeneralized ) ; } catch ( OnDemandStatsProducerException limitReachedException ) { log . warn ( "Query limit reached for query " + statement + ", --> " + statementGeneralized ) ; } //add Request Count, increase CR,MCR cumulatedStats . addRequest ( ) ; if ( statementStats != null ) statementStats . addRequest ( ) ; // start stopwatch boolean success = true ; try { Object retVal = pjp . proceed ( ) ; // stop stopwatch return retVal ; } catch ( Throwable t ) { success = false ; cumulatedStats . notifyError ( t ) ; if ( statementStats != null ) statementStats . notifyError ( ) ; throw t ; } finally { final long callDurationTime = System . nanoTime ( ) - callTime ; //add execution time cumulatedStats . addExecutionTime ( callDurationTime ) ; if ( statementStats != null ) statementStats . addExecutionTime ( callDurationTime ) ; //notify request finished / decrease CR/MCR cumulatedStats . notifyRequestFinished ( ) ; if ( statementStats != null ) { statementStats . notifyRequestFinished ( ) ; } addTrace ( statement , success , callDurationTime ) ; } }
Perform MoSKito profiling .