[code.view]

[top] / python / PyMOTW / profile / profile_stats_callers.py

     #!/usr/bin/env python
     # encoding: utf-8
     #
     # Copyright (c) 2008 Doug Hellmann All rights reserved.
     #
     """
     """
     
     __version__ = "$Id$"
     #end_pymotw_header
     
     import profile
     import pstats
     from profile_fibonacci_memoized import fib, fib_seq
     
     # Read all 5 stats files into a single object
     stats = pstats.Stats('profile_stats_0.stats')
     for i in range(1, 5):
         stats.add('profile_stats_%d.stats' % i)
     stats.strip_dirs()
     stats.sort_stats('cumulative')
     
     print 'INCOMING CALLERS:'
     stats.print_callers('\(fib')
     
     print 'OUTGOING CALLEES:'
     stats.print_callees('\(fib')
     

[top] / python / PyMOTW / profile / profile_stats_callers.py

contact | logmethods.com