| Author |
Message |
HiPerFreak
Joined: 14 Jul 2011 Posts: 1
|
Posted: Thu Jul 14, 2011 7:35 am Post subject: An API would be REALLY useful/Can I profile parts of tests? |
|
|
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 |
|
 |
AndrewH
Joined: 17 Aug 2006 Posts: 137
|
Posted: Thu Jul 14, 2011 10:34 am Post subject: |
|
|
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 |
|
 |
Laura Morley
Joined: 22 Jun 2011 Posts: 34 Location: Red Gate Software
|
Posted: Thu Jul 14, 2011 10:42 am Post subject: |
|
|
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 |
|
 |
|
|
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