apinstein
apinstein

Reputation: 5223

Flex Builder Profiling: can you programmatically start/stop profiling?

I just got Flex Builder Professional for the profiling support, and although I can make the profiler work, I am having trouble isolating samples to just a section of my code. Trying to click "clear profiling data" and "stop collecting" in the UI just isn't cutting it.

I'd like to be able to, in my code, do something like:

startProfiling(); // do stuff stopProfiling();

and have that "snapshot" of profiling data visible in the UI.

I can't find any information on this online at all. I know about flash.sampler.* but I don't know how to make flex builder and flash.sampler talk to each other.

This is a pretty routine way to trigger profiler data collection, and I am very frustrated trying to find a solution and hoping someone else has already figured it out.

Upvotes: 0

Views: 911

Answers (2)

Matt Chotin
Matt Chotin

Reputation:

So you checked out the flash.sampler APIs? When you hook up the profiler it is probably calling startSampling automatically. Have you tried calling pauseSampling from your app and then calling startSampling when you want just your stuff collected?

Upvotes: 1

Ryan Guill
Ryan Guill

Reputation: 13896

I don't believe this is possible. The profile in flex is like the debugger. You have to hook up to a specific instance of it and profile the application from start to finish. Here is a link that talks more about the Flex 3 profiler and might give you some more information on a different way to achieve what you are looking for.

http://labs.adobe.com/wiki/index.php/Flex_3:Feature_Introductions:_Performance_and_Memory_Profiling

Upvotes: 0

Related Questions