Documentation/Source/eric4.DebugClients.Python3.PyProfile.html

changeset 3
0d9daebf5b8c
equal deleted inserted replaced
2:bc6196164237 3:0d9daebf5b8c
1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
3 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
4 <html><head>
5 <title>eric4.DebugClients.Python3.PyProfile</title>
6 <style>
7 body {
8 background:white;
9 margin: 0em 1em 10em 1em;
10 color: black;
11 }
12
13 h1 { color: white; background: #4FA4FF; }
14 h2 { color: white; background: #4FA4FF; }
15 h3 { color: white; background: #00557F; }
16 h4 { color: white; background: #00557F; }
17
18 a { color: #AA5500; }
19
20 </style>
21 </head>
22 <body><a NAME="top" ID="top"></a>
23 <h1>eric4.DebugClients.Python3.PyProfile</h1>
24 <p>
25 Module defining additions to the standard Python profile.py.
26 </p>
27 <h3>Global Attributes</h3>
28 <table>
29 <tr><td>None</td></tr>
30 </table>
31 <h3>Classes</h3>
32 <table>
33 <tr>
34 <td><a href="#PyProfile">PyProfile</a></td>
35 <td>Class extending the standard Python profiler with additional methods.</td>
36 </tr>
37 </table>
38 <h3>Functions</h3>
39 <table>
40 <tr><td>None</td></tr>
41 </table>
42 <hr /><hr />
43 <a NAME="PyProfile" ID="PyProfile"></a>
44 <h2>PyProfile</h2>
45 <p>
46 Class extending the standard Python profiler with additional methods.
47 </p><p>
48 This class extends the standard Python profiler by the functionality to
49 save the collected timing data in a timing cache, to restore these data
50 on subsequent calls, to store a profile dump to a standard filename and
51 to erase these caches.
52 </p>
53 <h3>Derived from</h3>
54 profile.Profile
55 <h3>Class Attributes</h3>
56 <table>
57 <tr><td>dispatch</td></tr>
58 </table>
59 <h3>Methods</h3>
60 <table>
61 <tr>
62 <td><a href="#PyProfile.__init__">PyProfile</a></td>
63 <td>Constructor</td>
64 </tr><tr>
65 <td><a href="#PyProfile.__restore">__restore</a></td>
66 <td>Private method to restore the timing data from the timing cache.</td>
67 </tr><tr>
68 <td><a href="#PyProfile.dump_stats">dump_stats</a></td>
69 <td>Public method to dump the statistics data.</td>
70 </tr><tr>
71 <td><a href="#PyProfile.erase">erase</a></td>
72 <td>Public method to erase the collected timing data.</td>
73 </tr><tr>
74 <td><a href="#PyProfile.fix_frame_filename">fix_frame_filename</a></td>
75 <td>Public method used to fixup the filename for a given frame.</td>
76 </tr><tr>
77 <td><a href="#PyProfile.save">save</a></td>
78 <td>Public method to store the collected profile data.</td>
79 </tr><tr>
80 <td><a href="#PyProfile.trace_dispatch_call">trace_dispatch_call</a></td>
81 <td>Private method used to trace functions calls.</td>
82 </tr>
83 </table>
84 <a NAME="PyProfile.__init__" ID="PyProfile.__init__"></a>
85 <h4>PyProfile (Constructor)</h4>
86 <b>PyProfile</b>(<i>basename, timer = None, bias = None</i>)
87 <p>
88 Constructor
89 </p><dl>
90 <dt><i>basename</i></dt>
91 <dd>
92 name of the script to be profiled (string)
93 </dd><dt><i>timer</i></dt>
94 <dd>
95 function defining the timing calculation
96 </dd><dt><i>bias</i></dt>
97 <dd>
98 calibration value (float)
99 </dd>
100 </dl><a NAME="PyProfile.__restore" ID="PyProfile.__restore"></a>
101 <h4>PyProfile.__restore</h4>
102 <b>__restore</b>(<i></i>)
103 <p>
104 Private method to restore the timing data from the timing cache.
105 </p><a NAME="PyProfile.dump_stats" ID="PyProfile.dump_stats"></a>
106 <h4>PyProfile.dump_stats</h4>
107 <b>dump_stats</b>(<i>file</i>)
108 <p>
109 Public method to dump the statistics data.
110 </p><dl>
111 <dt><i>file</i></dt>
112 <dd>
113 name of the file to write to (string)
114 </dd>
115 </dl><a NAME="PyProfile.erase" ID="PyProfile.erase"></a>
116 <h4>PyProfile.erase</h4>
117 <b>erase</b>(<i></i>)
118 <p>
119 Public method to erase the collected timing data.
120 </p><a NAME="PyProfile.fix_frame_filename" ID="PyProfile.fix_frame_filename"></a>
121 <h4>PyProfile.fix_frame_filename</h4>
122 <b>fix_frame_filename</b>(<i>frame</i>)
123 <p>
124 Public method used to fixup the filename for a given frame.
125 </p><p>
126 The logic employed here is that if a module was loaded
127 from a .pyc file, then the correct .py to operate with
128 should be in the same path as the .pyc. The reason this
129 logic is needed is that when a .pyc file is generated, the
130 filename embedded and thus what is readable in the code object
131 of the frame object is the fully qualified filepath when the
132 pyc is generated. If files are moved from machine to machine
133 this can break debugging as the .pyc will refer to the .py
134 on the original machine. Another case might be sharing
135 code over a network... This logic deals with that.
136 </p><dl>
137 <dt><i>frame</i></dt>
138 <dd>
139 the frame object
140 </dd>
141 </dl><a NAME="PyProfile.save" ID="PyProfile.save"></a>
142 <h4>PyProfile.save</h4>
143 <b>save</b>(<i></i>)
144 <p>
145 Public method to store the collected profile data.
146 </p><a NAME="PyProfile.trace_dispatch_call" ID="PyProfile.trace_dispatch_call"></a>
147 <h4>PyProfile.trace_dispatch_call</h4>
148 <b>trace_dispatch_call</b>(<i>frame, t</i>)
149 <p>
150 Private method used to trace functions calls.
151 </p><p>
152 This is a variant of the one found in the standard Python
153 profile.py calling fix_frame_filename above.
154 </p>
155 <div align="right"><a href="#top">Up</a></div>
156 <hr />
157 </body></html>

eric ide

mercurial