[2.0.0-RC1] Additional Logging


can some help me with additional logging for gatling scenario…
I need to gather info about response size for all successful requests.
So I know how to perform http check for status code value but how to
log the response length?

I thought about having some sort of csv report “url”,“status code”,“response length”
but I don’t know how to implement it with scala in gatling…

Thank beforehand!

What do you mean by “response length” exactly?
The length of the body String?
The number of bytes received on the socket (very different: compression, encoding)?

Yep - response string legth

There’s already a bodyString check that gives you access to the body String: http://gatling.io/docs/2.0.0-RC2/http/http_check.html#http-response-body

All you need is to add a transform step to check the length: http://gatling.io/docs/2.0.0-RC2/http/http_check.html#transforming

.check(bodyString.transform(s => s.length).is(yourExpectedValue))

Cool. This will check the length but how can i log it to file?
Are there any way of logging some check results to additional log file so I can make some statistics report?

The only thing you can do is http://gatling.io/docs/2.0.0-RC2/http/http_protocol.html#dumping-custom-data

Thanks! i’ll take a look at this.

Don’t want to start new thread so I’ll ask here.

When I use assertion for global number of failed requests - will script finish when this value achieved or will it
continue and then just log assertions result?

On completion.

Have any concerns about adding stop on assert fail feature?
This would be a great for testing cases when, for example, I need to test for how long a server can handle certain
load before it stops responding. For example I need to increase load until I get more than 10% of failed requests. :slight_smile:

Now, as I understand, I can only wait while test script is finished and then check for percent of failed requests.
Stop on assert fail could save some time in such cases.


Planned for 2.1 where we intend to have proper live stats.

Glad to hear it!
Thanks a lot for your effort!