~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/lsprof.py

  • Committer: Marius Kruger
  • Date: 2008-11-08 22:36:58 UTC
  • mto: This revision was merged to the branch mainline in revision 240.
  • Revision ID: amanic@gmail.com-20081108223658-arwmwu7169dr1m20
* Change init info tabs->spaces
* some refactoring
* make paths more suitable to installed version
* starting/stopping will give better info

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: