使用 Cucumber 进行压力测试

发布于 2024-09-28 10:56:13 字数 288 浏览 0 评论 0原文

我目前正在使用 cucumber 为 RoR REST API 编写集成测试。

我还想对 API 进行压力测试,并且想知道如何重新使用我的 Cucumber 场景来执行此操作。

我之前使用过 JMeter 和 httperf 进行压力测试,当然,使用这两种工具都必须编写或记录我想要包含在压力测试中的测试。由于我已经有了想要测试的 Cucumber 场景,因此我试图避免重写压力测试工具语法中基本相同的场景。

有人可以推荐一种我可以使用我的 cuke 测试的方法吗?理想情况下,我想模拟数百个并发用户访问 API。

I'm currently writing integration tests for a RoR REST API using cucumber.

I'd also like to stress-test the API and was wondering how I might be able to re-use my cucumber scenarios to do this.

I've used JMeter and httperf before for stress-tests, and of course with both tools had to write or record the tests that I wanted to include in the stress testing. Since I already have the scenarios in Cucumber that I want to test, I'm trying to avoid having to rewrite what would be largely the same scenarios in the stress-testing tool's syntax.

Can anybody recommend a way that I could use my cuke tests for this? Ideally, I'd like to simulate hundreds of concurrent users hitting the API.

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

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

发布评论

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

评论(2

岁月流歌 2024-10-05 10:56:13

您很可能必须创建自己的负载线束。本质上,您需要启动多个线程,每个线程都调用进程来启动您的场景。当每个线程启动时,您会希望有一个延迟交错,因为加载 Ruby 解释器会产生一些开销。出于同样的原因,您可能还必须将负载分散到多台计算机上。最好在单独的进程中执行此操作。也许这对新项目有好处?

You very well may have to create your own load harness. Essentially, you'll need to start up a number of threads, each calling the process to start your scenarios. You will want to have a delay to stagger when each thread starts because there will be some overhead involved with loading the Ruby interpreter. You may also have to spread the load across more than one machine for the same reasons. It would probably be best to do this in separate processes. Perhaps this might be good for a new project?

再浓的妆也掩不了殇 2024-10-05 10:56:13

嗯,创建一些对 httpref 执行系统调用的步骤怎么样?

Hmm, what about creating some steps that perform a system call to httpref ?

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