Trees | Indices | Help |
|
---|
|
1 ########################################################################### 2 # 3 # This program is part of Zenoss Core, an open source monitoring platform. 4 # Copyright (C) 2007, Zenoss Inc. 5 # 6 # This program is free software; you can redistribute it and/or modify it 7 # under the terms of the GNU General Public License version 2 or (at your 8 # option) any later version as published by the Free Software Foundation. 9 # 10 # For complete information please visit: http://www.zenoss.com/oss/ 11 # 12 ########################################################################### 13 import os 14 import hotshot 15 import hotshot.stats 16 import tempfile 1719 2336 3725 stats = hotshot.stats.load(self.fname) 26 stats.sort_stats('time', 'calls') 27 stats.print_stats(limit)28 3335 os.remove(self.fname)39 """ 40 Decorator that will profile a function and print stats. 41 """ 42 def inner(*args, **kwargs): 43 p = Profiler() 44 result = p.runcall(f, *args, **kwargs) 45 p.print_stats() 46 return result47 return inner 48
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1.1812 on Tue Oct 11 12:51:49 2011 | http://epydoc.sourceforge.net |