~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/lsprof.py

  • Committer: Jelmer Vernooij
  • Date: 2008-08-06 18:33:20 UTC
  • mto: (197.1.9 pathargs)
  • mto: This revision was merged to the branch mainline in revision 202.
  • Revision ID: jelmer@samba.org-20080806183320-6llann0k480dlb9y
add --log-folder option.

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: