Project

General

Profile

« Previous | Next » 

Revision 3272

sql.py: DbConn.with_savepoint(): Profile (nested) transactions so that the run time for groups of commands (e.g. csv2db INSERTs) is known

View differences:

sql.py
414 414
        top = self._savepoint == 0
415 415
        savepoint = 'level_'+str(self._savepoint)
416 416
        
417
        if self.debug:
418
            self.log_debug('Begin transaction', level=3)
419
            profiler = profiling.ItersProfiler(start_now=True, iter_text='row')
420
        
417 421
        # Must happen before running queries so they don't get autocommitted
418 422
        self._savepoint += 1
419 423
        
......
439 443
            self._savepoint -= 1
440 444
            assert self._savepoint >= 0
441 445
            
446
            if self.debug:
447
                profiler.stop(self.profile_row_ct)
448
                self.log_debug('End transaction\n'+profiler.msg(), level=3)
449
            
442 450
            self.do_autocommit() # OK to do this after ROLLBACK TO SAVEPOINT
443 451
    
444 452
    def do_autocommit(self):

Also available in: Unified diff