~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/lsprof.py

  • Committer: Martin Albisetti
  • Date: 2008-08-04 23:46:37 UTC
  • Revision ID: argentina@gmail.com-20080804234637-a26xh9ea6ge86o4k
Why do we still have turbogears laying around?

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
#
1
3
# this is copied from the lsprof distro because somehow
2
4
# it is not installed by distutils
3
5
# I made one modification to profile so that it returns a pair
36
38
        for pp in _g_threadmap.values():
37
39
            pp.disable()
38
40
        threading.setprofile(None)
39
 
    
 
41
 
40
42
    threads = {}
41
43
    for tid, pp in _g_threadmap.items():
42
44
        threads[tid] = Stats(pp.getstats(), {})
112
114
        self.out_file = None
113
115
 
114
116
    def output(self, out_file):
115
 
        self.out_file = out_file        
 
117
        self.out_file = out_file
116
118
        print >> out_file, 'events: Ticks'
117
119
        self._print_summary()
118
120
        for entry in self.data: