简体   繁体   中英

Looking for a continuous integration profiler (C#)

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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM