简体   繁体   English

寻找持续集成探查器(C#)

[英]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. 我知道像dottrace这样的工具可以分析我的代码,但是我想要的是一个每晚进行分析并向我发送报告的工具,然后我可以知道哪些代码需要改进。

From this is seems that ANTS Profiler can do that: 这个是好像蚂蚁探查可以这样做:

ANTS Profiler can profile a unit test. ANTS Profiler可以分析单元测试。 The method for doing this is to set ANTS Profiler to profile a .NET desktop application, then choose the path to NUnit-gui.exe. 这样做的方法是将ANTS Profiler设置为对.NET桌面应用程序进行概要分析,然后选择NUnit-gui.exe的路径。 Once ANTS Profiler starts NUnit for you, you can load your test assembly and run your unit test. 一旦ANTS Profiler为您启动NUnit,您就可以加载测试程序集并运行单元测试。 During the unit test, you can take snapshots from ANTS Profiler, and profiling will stop when NUnit's window is closed. 在单元测试期间,您可以从ANTS Profiler拍摄快照,并且当NUnit的窗口关闭时,分析将停止。

It would also be possible to profile the console version on NUnit in the same fashion. 也可以用相同的方式在NUnit上配置控制台版本。 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. 除了选择nunit-console.exe作为要分析的应用程序外,还要在“参数”框中指定要加载的程序集的名称和适当的选项。

While this answer sounds like a critique of Anton's answer, it's really a critique of your question. 虽然此答案听起来像是对Anton答案的批评,但实际上是对您问题的批评。

The citation in Anton's answer says "yes, you can profile unit tests". Anton的答案中的引用是“是的,您可以分析单元测试”。 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" 它的全部含义是“没有理由不让您正在分析的东西不能是您的DLL位于测试运行器中-我们不只是剖析您所知道的EXE文件”

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. 您不对此类内容使用探查器,而是像常规单元测试那样使用时序来进行常规性能测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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