create and bookmark regions from code?

Code profiling for .NET Developers

Moderators: Luke Jefferson, StephenC, Alex.Davies, AndrewH, melvyn.harbour, Laura Morley

create and bookmark regions from code?

Postby springy » Thu Feb 10, 2011 6:52 pm

Hello,

does there exist something similar to
Code: Select all
RedGate.MemoryProfiler.Snapshot.TakeSnapshot()

for the Performance Profiler?

I would prefer an IDisposable pattern which records the region-end on dispose:

Code: Select all
using( RedGate.PerformanceProfiler.Regions.StartRegion("name of region") )
{
  // some lengthy code
}
springy
 
Posts: 12
Joined: Fri Feb 04, 2011 5:26 pm

Postby Chris.Allen » Fri Feb 11, 2011 3:14 pm

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
Chris.Allen
 
Posts: 594
Joined: Thu Mar 12, 2009 4:17 pm

Re:

Postby springy » Sat Feb 12, 2011 2:39 pm

Chris.Allen wrote: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.

Chris.Allen wrote: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
 
Posts: 12
Joined: Fri Feb 04, 2011 5:26 pm

Re:

Postby AndrewH » Mon Feb 14, 2011 12:43 pm

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.
AndrewH
 
Posts: 134
Joined: Thu Aug 17, 2006 3:44 pm


Return to ANTS Performance Profiler 6

Who is online

Users browsing this forum: No registered users and 1 guest