gatling系列教程(翻译)-第二节(What’s New in 2.2)

梦想的初衷 提交于 2019-12-05 18:11:18

JDK

Gatling now requires JDK8. JVM default tuning uses G1 Garbage Collector, so we strongly advice you use a very up-to-date JDK, not early versions.

gatling要求使用Jdk1.8,jvm默认调整使用G1垃圾收集器,因此我们强烈建议你使用最新JDK,而不是老版本的JDK.

Core

Feeder Shuffle

You can now shuffle a feeder content before enqueuing its content, see Feeder documentation for more details.

Assertions

Gatling now supports “per-million” assertions, similar to “percent” ones.

Conditional Checks (since 2.2.1)

It’s now possible to only perform a given check when a given condition is met. See Conditional Checks documentationfor more details.

HTTP

Native Transport

Gatling is now based on Netty 4 that provide an optional native epoll-based NIO re-implementation (different from JDK NIO) which can give better throughput. This option is only available on Linux. See Netty documentation for more details.

Gatling ships with the required jar, but the option is turned down by default.

In order to enable it, set gatling.http.ahc.useNativeTransport to true in gatling.conf.

OpenSSL Support

Netty 4 also provides a support for OpenSSL and BoringSSL. See Netty documentation for more details.

Gatling doesn’t ship the required jar and it depends on your operating system and if you want static or dynamic binding. You’re expected to manually add the suited library to Gatling’s classpath.

In order to enable it, set gatling.http.ahc.useOpenSsl to true in gatling.conf.

Forms Support

You can now use the form("cssSelector").saveAs("myForm") check to capture a Map[String, Seq[String]] of all the inputs of an HTML form at once.

You can then feed them back to a later request. See HTTP request documentation for more details.

Polling Support

Gatling now supports HTTP polling, see HTTP polling documentation for more details.

Hostname Resolution

By default, virtual users now use a shuffled list of the DNS records Gatling gets from the JDK. If you use DNS round-robin, this will balance your virtual users amongst the nodes of a static cluster.

Alternatively, you can enable perUserNameResolution on the HTTP protocol and have each virtual user perform DNS resolution on its own. This, way, your virtual users would be properly balanced if your cluster grows elastically under load. See HTTP protocol documentation for more details.

We also support DNS fail-over, meaning that virtual users will try the next DNS record of they couldn’t connect to the first address.

Hostname Aliasing

You can bypass hostname resolution and define aliases in hostNameAliases on the HTTP protocol. See HTTP protocol documentation for more details.

Local Addresses

It’s now possible to pass multiple local addresses to the HTTP protocol in localAddresses. See HTTP protocol documentation for more details.

Reports

JUnit Format Report File

Gatling now generates a JUNIt format report file based on the assertions in your simulation. This file is generated as /js/assertions.xml.

Groups Duration

You can switch from Group cumulated response times to duration when generating the reports. See gatling.charting.useGroupDurationMetric option in gatling.conf

Maven Plugin

The Gatling Maven plugin now provides test and integration-test that are bound to the phases of the same name.

It also now provides a useOldJenkinsJUnitSupport that exposes our JUnit file to Jenkins. At some point, we’ll provide a native support.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!