An API would be REALLY useful/Can I profile parts of tests?
HiPerFreak
Posts: 2
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
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
Comments
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.
Software Developer
Red Gate Software Ltd.
* 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.