Logo Search packages:      
Sourcecode: zope-callprofiler version File versions

def CallProfiler::profiler::Transaction::calculate_totals (   self,
  call 
)

Figure the totals and percentages

Definition at line 240 of file profiler.py.

00240                                     :
        '''Figure the totals and percentages
        '''
        processing = 0
        for event in call['events']:
            if event.has_key('meta_type'):
            key = (event['meta_type'], event['object'])
            count = self.num_calls.get(key, 0) + 1
            self.num_calls[key] = count
            event['call_count'] = count
            if count == 1:
                event['str_call_count'] = ''
            elif count%10 == 1:
                event['str_call_count'] = '(%dst call)'%count
            elif count%10 == 2:
                event['str_call_count'] = '(%dnd call)'%count
            elif count%10 == 3:
                event['str_call_count'] = '(%drd call)'%count
            else:
                event['str_call_count'] = '(%dth call)'%count
                self.calculate_totals(event)
            else:
                processing += event['time_total']
            event['percentage'] = event['time_total']*100 / self.time_total
        call['time_processing'] = processing
        call['percentage_processing'] = processing*100 / self.time_total

    def __str__(self):


Generated by  Doxygen 1.6.0   Back to index