create and bookmark regions from code?

Hello,

does there exist something similar to
RedGate.MemoryProfiler.Snapshot.TakeSnapshot()
for the Performance Profiler?

I would prefer an IDisposable pattern which records the region-end on dispose:
using( RedGate.PerformanceProfiler.Regions.StartRegion("name of region") )
{
  // some lengthy code
}

Comments

  • No. Sorry.

    The profiler doesn't have a snapshot model. It has a "time-line" model where you profile all of your application and if you need to filter out specific times, you can click and drag on the time line.

    So, two things that might help you are "user events"- this is a way of 'synchronizing' your code to the time line. Please check the out here:

    http://www.red-gate.com/supportcenter/C ... wledgebase\ANTS_Performance_Profiler\KB200811000319.htm&p=ANTS%20Performance%20Profiler

    (its not restricted to ASP.NET).

    Secondly, as far as automation of a profiling session goes, we have the command-line version called profiler.exe. Deatils here:

    http://www.red-gate.com/supportcenter/C ... e_Profiler\help\6.2\app_commandline.htm&p=ANTS%20Performance%20Profiler
  • The profiler doesn't have a snapshot model. It has a "time-line" model where you profile all of your application and if you need to filter out specific times, you can click and drag on the time line.

    Yeah, and I can created pinned+named regions out of the selection -- and that's exactly what I wanted to pregenerate automatically from within the profiled application; just the same way as I can create snapshots when profiling memory.
    So, two things that might help you are "user events"- this is a way of 'synchronizing' your code to the time line. Please check the out here:
    http://www.red-gate.com/supportcenter/C ... wledgebase\ANTS_Performance_Profiler\KB200811000319.htm&p=ANTS%20Performance%20Profiler
    (its not restricted to ASP.NET).

    I'll give it a try.

    But one thought so far:
    The doc says
    "provided there were no concurrent accesses to this page or background threads"
    :
    Since the profiler already has the possibility to filter by a specific thread, why not capture the thread which triggered the user-event (or the creation of a pinned region).
  • springy wrote:
    Since the profiler already has the possibility to filter by a specific thread, why not capture the thread which triggered the user-event (or the creation of a pinned region).

    There's certainly some room for improvement in this regard, but there is a way to achieve what you want in ANTS 6. If you select a small region around the the user event, you can click the event to select the method that it occurred in.

    The time the method was executing will appear as a green bar in the timeline: you can now click this to select the entire time that that particular method was executing - additionally, the tooltip for the bar will tell you which thread it was running in. You can also switch to the call graph to analyse only the time spent in that particular method.
    Andrew Hunter
    Software Developer
    Red Gate Software Ltd.
Sign In or Register to comment.