Specifying parts to profile

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

Comments

  • You can currently turn it on and off only from the UI. I'd recommend something like:

    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.
    Jason Crease
    Red Gate Software
  • Great news - I've got an active "1 year support & upgrades"; does that include v3?
  • Tried my licence no in the upgrader - it says the latest version is 2. Has v3 not been releaset yet?
  • Ouch, sorry, I got carried away there... Any way to get on the beta program?
  • v3 should be out about Q1/Q2 this year. I'm afraid it is an internal beta only, but I'll get in contact with you personally with further details about the release.
    Jason Crease
    Red Gate Software
Sign In or Register to comment.