Changeset 852
- Timestamp:
- 11/29/05 12:34:56
- Files:
-
- trunk/cherrypy/lib/profiler.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/lib/profiler.py
r829 r852 42 42 pstats.func_strip_path = new_func_strip_path 43 43 44 import hotshot44 import profile 45 45 import os, os.path 46 46 import sys … … 66 66 self.count += 1 67 67 path = os.path.join(self.path, "cp_%04d.prof" % self.count) 68 prof = hotshot.Profile(path)68 prof = profile.Profile() 69 69 prof.runcall(func, *args) 70 prof. close()70 prof.dump_stats(path) 71 71 72 72 def statfiles(self): … … 77 77 def stats(self, filename, sortby='cumulative'): 78 78 """stats(index) -> output of print_stats() for the given profile.""" 79 from hotshot.stats import load 80 s = load(os.path.join(self.path, filename)) 79 s = pstats.Stats(os.path.join(self.path, filename)) 81 80 s.strip_dirs() 82 81 s.sort_stats(sortby)

