Javascript Profiling: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 20: Line 20:
If some other Profiler object is profiling the runtime, then an error is thrown. Eventually a call to stop() must be paired with this call to cease data collection.
If some other Profiler object is profiling the runtime, then an error is thrown. Eventually a call to stop() must be paired with this call to cease data collection.
<dt>isProfiling()
<dt>isProfiling()
<dd>Returns whether profiling is turned on for the runtime
<dd>Returns whether profiling is active for this Profiler instance
<dt>frame()
<dt>frame()
<dd>Fetches an object to represent the current stack trace to be later returned via results(). This object can have any properties attached to it and will persist across different invocations of frame() so long as the same backtrace is present each time. All information specified here will later be available via results() with the full backtrace listed. By default this returns an empty object with no properties. If the current runtime is not being profiled, then an error is thrown.
<dd>Fetches an object to represent the current stack trace to be later returned via results(). This object can have any properties attached to it and will persist across different invocations of frame() so long as the same backtrace is present each time. All information specified here will later be available via results() with the full backtrace listed. By default this returns an empty object with no properties. If the profiler is not active, then an error is thrown.
<dt>results()
<dt>results()
<dd>Returns all profile information for the runtime. The data returned is all that is collected between the last invocation of reset() and all the profile data.
<dd>Returns all profile information gathered. The data returned is all that is collected between the last invocation of reset() and all the sample data.
<dt>reset()
<dt>reset()
<dd>Resets all information known about the runtime. This includes samples and also frame() information. Throws an error if the runtime in question isn't being profiled.
<dd>Resets all information that is stored. This includes samples and also frame() information. Throws an error if the profiler isn't active.
<dt>stop()
<dt>stop()
<dd>Ceases profiling on the runtime. If the runtime in question isn't being profiled, an error is thrown.
<dd>Ceases profiling on the runtime. If this profiler is not active, an error is thrown.


</dl>
</dl>
22

edits