emma是否支持多个进程并发写入会话文件?

发布于 2024-08-02 05:30:32 字数 156 浏览 4 评论 0原文

如果我在 emma 中检测两个 jar,将它们指向同一个 emma 会话文件,然后同时运行它们(例如,客户端和服务器),我应该期望事情正常工作还是惨败?这些罐子是用公共源构建的,所以我预计元数据不会出现问题。

我在文档中没有看到任何有关此内容的内容,因此如果有的话,肯定会欢迎指针。

If I instrument two jars in emma, point them to the same emma session file, and then run them concurrently (e.g., a client and a server), should I expect things to work or fail miserably? The jars are building out of common source, so I don't expect problems with the metadata.

I didn't see anything about this in documentation, so if it is there a pointer would certainly be welcomed.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

如日中天 2024-08-09 05:30:32

不,不能。当流程大部分结束时,艾玛会写出检测结果。它会覆盖现有位置的任何文件,但它也会写出一个文本文件,并且不直接支持合并或合并多个报告。

不过,有一个分析工具可以帮助您执行此操作,称为 Grobo。它具有“安全”分析模式,将每个事件写入日志文件,然后关闭该日志文件。这可能允许多个实例运行并输出到同一位置,并为您提供最新的分析信息,而无需关闭进程。旧版本曾经允许合并覆盖率报告,但最新版本没有提及。我过去曾使用过它,Tomcat 在完成写入之前杀死了 Emma 分析线程,在这种情况下,安全模式可以确保所有覆盖数据的写入都没有问题。它还可以用于通过一组测试来获得部分覆盖率,这对于集成测试有时非常有用。

另一种选择,也可能是最好的选择,是 Cobertura。它能够合并多个报告文件,因此您可以使用不同的输出文件运行每个 Java 进程,然后在最后将它们全部合并以生成合并覆盖率的报告。

No it can't. Emma writes out the result of instrumentation when the process ends for the most part. It overwrites any file in the existing position, but it is also writing out a text file and has no direct support for merging as it goes along or of merging multiple reports.

There is however a profiling tool that might help you do this called Grobo. It has a profiling mode "safe" which writes every event to the logging file and then closes that log file. That may allow multiple instances to run and output to the same place and give you up to date profiling information without shutting down the process. An older version used to allow the merging of coverage reports but the latest version makes no mention of it. I have used it in the past where Tomcat was killing the Emma profiling thread before it finished writing out, and in that scenario the safe mode worked to ensure all coverage data was written without problems. It can also be used to get coverage part way through a set of tests which with integration tests can sometimes be very useful.

The other option, and likely the best one, is Cobertura. It has the ability to merge multiple report files and hence you could run each of your Java processes with a different output file and then merge them all at the end to produce your report of combined coverage.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文