Specifying parts to profile
Jonas Beckeman
Posts: 10
Hi, I can't find any information on how to turn the profiler on/off from inside my code.
E.g. I have a performance problem when closing my app, but I don't care about the rest of the app's performance. I don't want the information up until I click the close button in my app, that just takes focus off of the real problem; I want to be able to turn the profiler on in the onclick method.
I would also like be able to categorize the profiler info, like "from here to here, mark the info as 'Rendering', and from here to here as 'Business logic'", so I can sort by category when analyzing the results.
Thanks,
Jonas
E.g. I have a performance problem when closing my app, but I don't care about the rest of the app's performance. I don't want the information up until I click the close button in my app, that just takes focus off of the real problem; I want to be able to turn the profiler on in the onclick method.
I would also like be able to categorize the profiler info, like "from here to here, mark the info as 'Rendering', and from here to here as 'Business logic'", so I can sort by category when analyzing the results.
Thanks,
Jonas
Comments
1) Click Disable on the toolbar
2) Click Start Profiler on the toolbar. This will start the profiler disabled
3) Navigate to relevant part of your app
4) Click enable on the toolbar
5) Interact with your app
6) Click 'take snapshot' on the toolbar
7) Click Disable on the toolbar
8) Click 'Reset Profiler' on the toolbar
Then repeat steps 4-9 for each part of your application. For each snapshot you will only get results from when you clicked enabled to when you took the snapshot.
To interact with ANTS from your code, this requires an ANTS API. This is not currently available, but will be in ANTS Version 3, released in about March/April 2007.
In ANTS 3, you can make calls in your code like:
RedGate.Profiler.Api.TakeSnapshot() or:
RedGate.Profiler.Api.Disable()
Which would be perfect for your problem.
Version 3 is a free upgrade if you have our support package. Otherwise, it's best to contact sales@red-gate.com and they'll prepare you a quote.
Red Gate Software
Red Gate Software