Quick patch to use hotshot instead of profile

Jeff Pitman <[email protected]>
Newsgroups gmane.linux.rpm.metadata
Message-ID <[email protected]>
Enclosed herein.  Use "printstats.py" in your home dir to get the info.

-- 
-jeff

_______________________________________________
Rpm-metadata mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/rpm-metadata
printstats.py (application/x-python, 187 B)
#!/usr/bin/python 

import hotshot.stats, os

stats = hotshot.stats.load(os.path.expanduser("~/createrepo.prof"))
stats.strip_dirs()
stats.sort_stats('time', 'calls')
stats.print_stats()
genpkgmetadata.py-hotshot.patch (text/x-diff, 769 B)
? printstats.py
Index: genpkgmetadata.py
===================================================================
RCS file: /cvsroot/metadata/cvs-root/generate/genpkgmetadata.py,v
retrieving revision 1.34
diff -u -3 -p -r1.34 genpkgmetadata.py
--- genpkgmetadata.py	2 Nov 2004 05:55:18 -0000	1.34
+++ genpkgmetadata.py	7 Jan 2005 05:07:20 -0000
@@ -494,8 +494,10 @@ def main(args):
 if __name__ == "__main__":
     if len(sys.argv) > 1:
         if sys.argv[1] == 'profile':
-            import profile
-            profile.run('main(sys.argv[2:])')
+            import hotshot
+            p = hotshot.Profile(os.path.expanduser("~/createrepo.prof"))
+            p.run('main(sys.argv[2:])')
+            p.close()
         else:
             main(sys.argv[1:])
     else:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.