annotate light8/profilereport.py @ 62:2f2eb802e93d

stage shows levels now. aims have blue halo for easy recognition. stage shows levels now. aims have blue halo for easy recognition. old dummy config stored
author dmcc
date Tue, 09 Jul 2002 08:35:27 +0000
parents 45b12307c695
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
45b12307c695 Initial revision
drewp
parents:
diff changeset
1 """
45b12307c695 Initial revision
drewp
parents:
diff changeset
2 tweak rsn.py to run the profile module, and write the output to files
45b12307c695 Initial revision
drewp
parents:
diff changeset
3 in profile/ with names that describe how you exercised the
45b12307c695 Initial revision
drewp
parents:
diff changeset
4 program. then run this program to make files in profile/html/ for
45b12307c695 Initial revision
drewp
parents:
diff changeset
5 easier viewing.
45b12307c695 Initial revision
drewp
parents:
diff changeset
6 """
45b12307c695 Initial revision
drewp
parents:
diff changeset
7
45b12307c695 Initial revision
drewp
parents:
diff changeset
8 import pstats,glob,os,time,sys
45b12307c695 Initial revision
drewp
parents:
diff changeset
9
45b12307c695 Initial revision
drewp
parents:
diff changeset
10 allfiles = glob.glob("profile/*")
45b12307c695 Initial revision
drewp
parents:
diff changeset
11 allfiles.remove('profile/html')
45b12307c695 Initial revision
drewp
parents:
diff changeset
12 allfiles.sort()
45b12307c695 Initial revision
drewp
parents:
diff changeset
13
45b12307c695 Initial revision
drewp
parents:
diff changeset
14 header = "profile output from %s<p>" % (time.ctime())
45b12307c695 Initial revision
drewp
parents:
diff changeset
15 for f in allfiles:
45b12307c695 Initial revision
drewp
parents:
diff changeset
16 f=f[8:]
45b12307c695 Initial revision
drewp
parents:
diff changeset
17 header = header+"<a href=%(f)s.html>%(f)s</a> | " % locals()
45b12307c695 Initial revision
drewp
parents:
diff changeset
18
45b12307c695 Initial revision
drewp
parents:
diff changeset
19 for profileoutput in allfiles:
45b12307c695 Initial revision
drewp
parents:
diff changeset
20
45b12307c695 Initial revision
drewp
parents:
diff changeset
21
45b12307c695 Initial revision
drewp
parents:
diff changeset
22
45b12307c695 Initial revision
drewp
parents:
diff changeset
23 s=pstats.Stats(profileoutput)
45b12307c695 Initial revision
drewp
parents:
diff changeset
24
45b12307c695 Initial revision
drewp
parents:
diff changeset
25 f=open("profile/html/%s.html" % profileoutput[8:],'w')
45b12307c695 Initial revision
drewp
parents:
diff changeset
26 sys.stdout=f
45b12307c695 Initial revision
drewp
parents:
diff changeset
27 print header,"<pre>"
45b12307c695 Initial revision
drewp
parents:
diff changeset
28 s.sort_stats('cumulative').print_stats(15).print_callers(15)
45b12307c695 Initial revision
drewp
parents:
diff changeset
29 print "</pre>"
45b12307c695 Initial revision
drewp
parents:
diff changeset
30