Red Gate forums :: View topic - An API would be REALLY useful/Can I profile parts of tests?
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Performance Profiler 6
ANTS Performance Profiler 6 forum

An API would be REALLY useful/Can I profile parts of tests?

Search in ANTS Performance Profiler 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
HiPerFreak



Joined: 14 Jul 2011
Posts: 1

PostPosted: Thu Jul 14, 2011 7:35 am    Post subject: An API would be REALLY useful/Can I profile parts of tests? Reply with quote

I have a unit tests which simulates a slow usage scenario and I want to profile a certain part of this unit test method with the ANTS Performance profile. How can I do this?

Something similar to the old profiler API (the RedGate.Profiler.Api.dll) would be very useful for this!

Does such an API exist or is it planned? Is there any alternative?

Thank you very much,
Daniel
Back to top
View user's profile Send private message
AndrewH



Joined: 17 Aug 2006
Posts: 137

PostPosted: Thu Jul 14, 2011 10:34 am    Post subject: Reply with quote

There is an API available for ANTS which can mark regions on the timeline: see 'adding custom event markers' here for details. Once the regions are marked, you can just select those relating to the tests you're interested in.

However, this is probably unncecessary for unit tests: as these are implemented as individual methods, you can just select the relevant method in the list. ANTS will draw a green bar on the timeline to show the times when the method was running, and you can click on this to inspect what was going on during that time. The call graph is also very useful for inspecting how an individual method is behaving.
_________________
Andrew Hunter
Software Developer
Red Gate Software Ltd.
Back to top
View user's profile Send private message
Laura Morley



Joined: 22 Jun 2011
Posts: 34
Location: Red Gate Software

PostPosted: Thu Jul 14, 2011 10:42 am    Post subject: Reply with quote

If you're looking for pointers on how to set up profiling for your unit test, and it's in Nunit or MSTest, then you may find the following instructions useful:
* Profiling units tests using NUnit
* Profiling tests in MSTest
Essentially, both methods involve telling ANTS Performance Profiler to profile your test assembly. When it's profiling you can then, as Andrew suggests, use the call tree to select the method for the test in which you're interested.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group