Project

General

Profile

« Previous | Next » 

Revision 9524

lib/profiling.py: Profiler: added add_subprofiler(), for use with cumulative profilers

View differences:

lib/profiling.py
20 20
        self.add_time(dates.now() - self.start_)
21 21
    
22 22
    def msg(self): return 'Took '+str(self.total)+' sec'
23
    
24
    def add_subprofiler(self, profiler):
25
        '''for use with cumulative profilers'''
26
        self.add_time(profiler.total)
23 27

  
24 28
class ItersProfiler(Profiler):
25 29
    def __init__(self, iter_text='iteration', **settings):
......
42 46
            +format.to_si(float(dates.total_seconds(self.total))/self.iter_ct)
43 47
            +'s/'+self.iter_text)
44 48
        return msg
49
    
50
    def add_subprofiler(self, profiler):
51
        Profiler.add_subprofiler(self, profiler)
52
        self.add_iters(profiler.iter_ct)

Also available in: Unified diff