Jmeter与Gatling的性能测试比较,2020年

huangapple go评论109阅读模式
英文:

Jmeter vs Gatling for performance testing 2020

问题

我正在尝试将Gatling与JMeter进行性能测试比较。

我的要求是:

  1. 我希望与CI/CD和自动化兼容。
  2. 性能应该良好(我知道在资源占用方面,Gatling的性能稍好一些)。
  3. 动态性 -> 即能够运行测试,更改环境中的一些设置,然后再次运行测试。
  4. 在云上使用(我觉得因为Gatling在性能方面表现更好,所以在云上可能会更好...但我不知道这里是否真的有很大的区别)。
  5. 我正在测试一个单体系统,所以我无法像拆分微服务那样将系统拆分得很好,使用模拟(mockito)将更难以获得关于例如端点请求的更精确性能数据,排除数据库时间等。所以这意味着我所进行的性能测试更像是压力测试,测试系统的整体性能,而不是获取系统各个隔离部分的测量数据。

任何帮助都将是有益的。我之所以询问,是因为很多信息似乎已经过时了...

编辑:我不担心Gatling是用Scala和Gatling DSL编程的。我更担心可能会有的限制和问题,这些我可能没有注意到!

英文:

I am trying to compare Gatling to Jmeter for performance testing.

My requirements is:

  1. I want compatibility with CI/CD and automation.
  2. Performance should be good (I know Gatling is a bit better performance in regard resource hogging).
  3. Dynamic -> i.e. able to run a test, change some settings in the environment, and then run the test again.
  4. Use on Cloud (I feel like because Gatling is better for performance, it would be better for the cloud... But I don't know if there really is a big difference here).
  5. I am testing a Monolith system, so I wont be able to split up the system as well (as microservices), and using mocks(mockito) will be harder to be able to get more exact performance on for example a request for an endpoint, excluding database time, etc. So this kind of means the performance test I suppose I will be doing is more of a stress test and testing general performance of system, rather then getting measurements of isolated parts of system.

Any help would be great. I ask because a lot of information seems to be out of date on this...

Edit: I amn't afraid of Gatling being programmed in Scala and gatling dsl. Im more afraid of limitations and gotchas that i amnt seeing!

答案1

得分: 3

免责声明:Gatling的创作者在此

个人观点,首要标准实际上应该是:你会感到最舒适使用哪个工具?

Gatling是面向代码的,与IDE(如IntelliJ或VSCode)很好地集成。
JMeter是面向图形界面的。

如果你懂编程,你可能会更喜欢Gatling,这样你可以使用你通常的开发环境和惯例(重构,同行审查等)。你不需要成为开发专家,你将主要使用Gatling的DSL(确保阅读官方文档并完成教程)。

相反,如果你不会编程(并且不想学习方法、参数、IDE等基础知识),你不应该选择Gatling,而应该选择JMeter。

注意:如果你正在寻找一个基于云的Gatling平台,我们提供Gatling FrontLine

英文:

Disclaimer: Gatling creator here

IMHO, first criterion should actually be: which tool would you feel the most comfortable with?

Gatling is code oriented, integrates nicely with IDEs such as IntelliJ or vscode.
JMeter is GUI oriented.

If you know about programming, you might prefer Gatling so you can use your usual dev environment and practices (refactoring, peer review, etc). You don't need to be a dev expert, you'll be mostly using Gatling's DSL (make sure to read the official documentation and go through the tutorials).

On the contrary, if you can't code (and don't want to learn the basics such as methods, parameters, IDE), you shouldn't go with Gatling and go with JMeter instead.

Note: if you're looking for a cloud based platform for Gatling, we provide Gatling FrontLine.

答案2

得分: 2

两种工具都支持您的所有要求,所以更多是个人偏好/经验的问题。

  1. Gatling支持的协议默认情况下较少(仅限于HTTPJMSMQTT),而JMeter支持更多协议。不过,您可以扩展两者并添加您选择的协议支持。
  2. 您需要进行一些额外的手动工作来设置Gatling分布式测试,而JMeter会自动在分布式模式中聚合来自从机的数据。
  3. Gatling更适合CI,因为它假定您使用Scala编写测试,而JMeter的测试创建方式是使用GUI,JMeter测试计划是一个XML文件,添加一个测试元素将会生成10多行的XML代码,这并不太易读。
英文:

Both tools support all your requirements so it's rather a matter of personal preference/experience.

  1. Gatling supports less protocols out of the box (limited to HTTP, JMS and MQTT) than JMeter, however it is possible to extend both and add support of the protocol(s) of your choice
  2. You will need to do some extra manual work in order to set up Gatling distributed testing while JMeter aggregates data from the slaves automatically in Distributed Mode
  3. Gatling is more CI friendly as it assumes writing tests in Scala while supported way of creating a JMeter test is using GUI and JMeter test plan is XML file and adding a single test element will result in 10+ lines of XML code which is not very readable.

答案3

得分: 0

以下是翻译好的内容:

两者都支持您的需求,

JMeter:

  1. 但是相比 Gatling,在 JMeter 中更容易进行关联和参数化。
  2. 在 JMeter 中,我们记录了响应,允许进行详细的关联。
  3. 在 JMeter 中,可以为验证和验证创建检查点,为事务命名标记,提供结构化的用户界面支持。总体而言,在 JMeter 中比在 Gatling 中更容易创建/记录脚本。

Gatling:

  1. Gatling 具有代码脚本编写功能,在 JMeter 中并非如此。
  2. Gatling 使用的内存和磁盘比 JMeter 较少。
  3. Gatling 在创建和处理更多虚拟用户、线程重用方面优于 JMeter。

@user3038404 现在 Gatling 也支持 Java 和 Gradle 用于性能测试(可能适合您)。

英文:

Both support your requirements,

JMeter :

  1. but more than gatling its easy in JMeter for correlation & Parameterisation.
  2. In JMeter we have recorded response which allows for details correlation.
  3. In JMeter Tagging Transaction names, Creating checkpoints for validation & verification, a structured UI support.
    overall script creation/ recording is easier in JMeter than in gatling.

Gatling :

  1. Gatling has a code scripting facility which is not a case in JMeter.
  2. Gatling uses less memory, Disk than JMeter
  3. Gatling is better with creating and handling more V-user, Thread re-use than JMeter.

@user3038404 now gatling also support Java & Gardle for PT (could be suitable for you)

huangapple
  • 本文由 发表于 2020年5月5日 17:29:01
  • 转载请务必保留本文链接:https://go.coder-hub.com/61609917.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定