conf gatling.data.file.bufferSize=8192 but 16K written (response.body.string via extraInfoExtractor?

Hi,

Version: gatling-charts-highcharts-bundle-2.1.5
Ubuntu 14.04 x86_64 .

java version “1.7.0_80”

The configuration item gatling.data.file.bufferSize is 8192 by default.
Using extraInfoExtractor to get the response.body.string, I get 16 kbytes of the response written to simulation.log.

My expectation is that with 8192 specified as bufferSize, the response.body.string would be chopped at 8192 bytes.

(Guessing here) This may be due to java allocating for unicode characters (2 bytes/char). And when plain ascii is used, there is 2X room.

Thanks

Sajjad

Gatling uses a simple buffer to encode the chars into it. It doesn’t try to grow it if you’re exceeding it, the default size is plenty enough if you’re not doing something weird, like trying to dump the whole response body into this TSV file. Then, you have to increase it.

(Guessing here) This may be due to java allocating for unicode characters (2 bytes/char). And when plain ascii is used, there is 2X room.

Java uses UTF-16 internally, but this has nothing to do with your problem. Gatling will use the encoding you’ve defined in gatling.conf (default is UTF-8)

Why do I get 16K of data when the buffer is configured to be 8K?

Because it doesn’t truncate.