views:

75

answers:

2

Hi all,

I would like to perfom automatic profiling on my code during my continuous integration.

I know tools like dottrace that allow to profile my code, but what I would like is a tool that each night makes profiling and send me a report then I can know which code needs to be improved.

Thanks in advance for any help

A: 

From this is seems that ANTS Profiler can do that:

ANTS Profiler can profile a unit test. The method for doing this is to set ANTS Profiler to profile a .NET desktop application, then choose the path to NUnit-gui.exe. Once ANTS Profiler starts NUnit for you, you can load your test assembly and run your unit test. During the unit test, you can take snapshots from ANTS Profiler, and profiling will stop when NUnit's window is closed.

It would also be possible to profile the console version on NUnit in the same fashion. In addition to choosing nunit-console.exe as the application to profile, specify the name of the assembly to load and the appropriate options in the Arguments box.

Anton Gogolev
That doesnt sound very CI at all!, i.e., what about that makes you think that its anything other than an interactive UI?
Ruben Bartelink
@Ruben How is that? Granted, link wasn't very obvious (that's due to crappy URL scheme on RedGates' site), but the whole point is to be able to performance tests in automated manner. The only way this can be done is by measuring performance of unit tests, since they require no user interaction.
Anton Gogolev
@Anton: Had started doing 57 comments but converted it to an answer....
Ruben Bartelink
@Anton : thanks I'll look at ants profiler@Ruben : Why do you think it's not very CI ?
Tim
There's no sign of anything like http://nhprof.com/learn/ContinuousIntegration i.e., there is no sign from Anton's quote that there is any support for running the profiler without someone looking at a GUI. And another thing, if you're going to go to the trouble of following Anton's suggestion, the least you can do is +1 his answer (even if he doesnt look like he's stuck for rep!)
Ruben Bartelink
A: 

While this answer sounds like a critique of Anton's answer, it's really a critique of your question.

The citation in Anton's answer says "yes, you can profile unit tests". In the same way that a debugger can debug unit tests. It does NOT say "and you can automatically dump it to disk and compare it to a previous run using this commandline option". All it says is "there is no reason why the thing you're profiling cannot be your DLL sitting inside a test runner - we don't just profile EXEs you wrote you know"

Even if there were settings to run from commandline and capture, what would you do with it? Are there tools that come with it that let you say "and complain if this falls outside of this tolerance" that can then act like a failing test and come out in the build report?

You dont use a profiler for stuff like this, you do normal performance tests with timings as a normal unit test would.

Ruben Bartelink