LR 自定义日志文件:如何从生成器中获取它们?

发布于 2024-10-08 09:05:45 字数 432 浏览 7 评论 0原文

假设我有一个 VUGen C 测试,它将结果写入某个数据日志文件,即它列出了已处理的 ID 或类似文件中的内容,该文件在初始化时创建(或附加),在主操作中写入,并在关闭时关闭。

然后我想知道是否有 LR 功能可以让我在控制器上找到包含该文件的所有 vuser 副本的统一目录结构?

据我所知,所有 vuser 实例都使用测试目录结构的一个公共副本,位于 temp 中的某处。因此,a) 我需要将 VUser ID 包含到自定义日志文件的名称中,b) 在场景执行后,我必须从负载生成器手动收集结果文件,这是一个笨拙的过程。

唯一舒适的替代方案是将所有已处理的 ID(或其他内容)报告到 VTS(HP 虚拟表服务器,似乎是免费软件)并从那里获取它们,对吧?然后我还有额外的编码要做。难道没有人错过过 VUgen/LR 中的这样一个功能吗?

我希望这不是太离题,因为这个问题不一定与代码相关。

Suppose I have a VUGen C test which writes results to some data log file, i.e. it lists processed IDs or something like that in a file that is created (or appended) upon init, written to in the main action, and closed upon shutdown.

Then I wonder if there is a LR functionality that allows me to find a consolidated directory structure on the controller containing all vusers' copies of that file?

As far as I can see, all vuser instances use one common copy of the test directory structure, located somewhere in temp. So a) I need to include the VUser ID into the name of my custom log file, and b) I have to collect the result files manually from my load generator after a scenario execution, which is a clumsy process.

The only comfortable alternative would be to report all processed IDs (or whatever) into VTS (HP virtual table server, seems to be freeware) and pick them up from there, right? Then I have additional coding to do. Can it be that nobody ever missed such a functionality in VUgen/LR?

I hope this is not too offtopic since this question is not neccessarily code-related.

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

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

发布评论

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

评论(2

⒈起吃苦の倖褔 2024-10-15 09:05:45

很简单,在测试期间使用 lr_output_message() 将自定义日志消息输出到控制器。在测试结束时,只需从输出窗口的导出中转储出所需的日志元素即可。

在测试期间您需要警惕大量日志记录。您可以很容易地将整个磁盘子系统变成测试的瓶颈,如果您在已经很繁忙的主机(例如控制器)上而不是在专用硬件上运行用户,那么这是双重的。使用lr_output_message() 可以使您从虚拟用户主机注销并将其移至控制器进行日志记录。

请务必包含一个参考或控制生成器,每种类型只有一个虚拟用户(与其余生成器匹配的硬件),以检查磁盘子系统是否成为瓶颈。

另外,如果您想在测试结束时恢复数据,并想完全考虑使用解耦主机,您可以查看 K Sandell 对公共主机/位置的 UNC 路径的建议,但需要管理锁,这会增加复杂性如果要访问公共文件,则与其他虚拟用户一起使用,或者只是在测试中包含另一个目标,例如 VTS、许多基于 Java 的消息队列解决方案中的任何一个,甚至是具有轻量级前端的 MySQL,只需使用形式。

Simple, use lr_output_message() to oputput your custom log message to the controller during the test. At the end of the test simply dump out the log elements you need from an export of the output window.

You will want to be wary of heavy logging during the test. You can quite easily turn your entire disk subsystem into a bottleneck for the test, this is double so if you are running users on an already busy host like the controller and not on a dedicated piece of hardware. Using lr_output_message() takes your log off of the virtual user host and moves it to the controller for logging.

Be sure to include a reference, or control generator, with only a single virtual user of each type staged upon it (hardware matched to the rest of your generators) to check against the disk subsystem becomming a bottleneck.

Also, if you want to recover the data at the end of the test and want to consider a decoupled host altogether you can look at K Sandell's suggestion of a UNC path to a common host/location, with the added complication of having to manage locks with other virtual users if going to a common file, or simply include another target in your test such as VTS, any of the many Java based messaeg queue solutions, or even MySQL with a light front end to simply push data into a table using a form.

琉璃繁缕 2024-10-15 09:05:45

无论 Performance Center 还是独立版,我们执行此操作的方法都是拥有可由脚本映射的 UNC 路径。然后我们在那里创建/写入/读取文件。

这允许从多个负载生成器运行脚本,而无需在测试后将任何文件复制到任何地方,并且还为我们提供了一个通用存储空间,我们可以在其中加载所有脚本所需的 DLL 和其他文件。

请注意,从两个不同的 vuser 创建/写入同一文件将不起作用,您应该创建 vuser_id 特定名称或使用数据库来存储数据。 DB 选项要求您手头有一个第 3 方 DB 库 (DLL)。

The way we do this, regardless of Performance Center or Standalone is to have a UNC path mappable by the scripts. We then create/write/read from files there.

This allows for running the scripts from multiple load-generators without having to copy any files anywhere after the test, and also gives us a general storage where we can load DLL's and other files needed by all the scripts.

Please note that creating/writing to the SAME file from two different vusers won't work, you should either create vuser_id specific names or use a database for storing the data. The DB option requires that you have a 3rd party DB library (DLL) at hand thou ..

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