Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 852

Show
Ignore:
Timestamp:
11/29/05 12:34:56
Author:
fumanchu
Message:

Changed profiler from hotshot to profile module. This allows Py2.4 users to profile C calls.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/lib/profiler.py

    r829 r852  
    4242pstats.func_strip_path = new_func_strip_path 
    4343 
    44 import hotshot 
     44import profile 
    4545import os, os.path 
    4646import sys 
     
    6666        self.count += 1 
    6767        path = os.path.join(self.path, "cp_%04d.prof" % self.count) 
    68         prof = hotshot.Profile(path
     68        prof = profile.Profile(
    6969        prof.runcall(func, *args) 
    70         prof.close(
     70        prof.dump_stats(path
    7171     
    7272    def statfiles(self): 
     
    7777    def stats(self, filename, sortby='cumulative'): 
    7878        """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)) 
    8180        s.strip_dirs() 
    8281        s.sort_stats(sortby) 

Hosted by WebFaction

Log in as guest/cpguest to create tickets