/** INTERNAL: Start the operation timing. */
 public void startOperationProfile(String operationName, DatabaseQuery query, int weight) {
   if (this.profileWeight < weight) {
     return;
   }
   startOperationProfile(operationName);
   startOperationProfile(
       TIMER
           + query.getMonitorName()
           + ":"
           + operationName.substring(TIMER.length(), operationName.length()));
 }
 public void occurred(String operationName, DatabaseQuery query) {
   if (this.profileWeight < SessionProfiler.NORMAL) {
     return;
   }
   occurred(operationName);
   occurred(
       COUNTER
           + query.getMonitorName()
           + ":"
           + operationName.substring(COUNTER.length(), operationName.length()));
 }
 /** INTERNAL: Monitoring is done on the endOperation only. */
 public Object profileExecutionOfQuery(DatabaseQuery query, Record row, AbstractSession session) {
   if (this.profileWeight < SessionProfiler.HEAVY) {
     return session.internalExecuteQuery(query, (AbstractRecord) row);
   }
   startOperationProfile(TIMER + query.getMonitorName());
   startOperationProfile(TIMER + query.getClass().getSimpleName());
   occurred(COUNTER + query.getClass().getSimpleName());
   occurred(COUNTER + query.getMonitorName());
   try {
     return session.internalExecuteQuery(query, (AbstractRecord) row);
   } finally {
     endOperationProfile(TIMER + query.getMonitorName());
     endOperationProfile(TIMER + query.getClass().getSimpleName());
     checkDumpTime();
   }
 }