Unfortunately this results in the following compilation error:
value getRawUrl is not a member of com.ning.http.client.Request
15:04:16.427 [ERROR] i.g.a.ZincCompiler$ - println("httpCode: " + ExtraInfo.response.statusCode + ", URL: "+ ExtraInfo.request.getRawUrl())
There has been a recent change on Async HTTP Client’s Request API, which does not appears AHC’s Javadoc since we use ATM a ‘custom’ AHC more recent that the latest published version. getRawUrl() has been removed from the Request’s API and, if you want to have to back you can use the UriComponents exposed by the Request’s API and call toUrl() on it :
extraInfoExtractor is initially meant to dump extra info the the simulation.log, produced when running Gatling, which holds the results of the simulation’s run.
So it expect a that you give it a list of “things” to dump to the simulation.log.
If the only thing you’re doing with it is a println, just add Nil after your println(…) just like Daniel did.
It means that you won’t dump any specific info to simulation.log, but your println will be executed nonetheless.
Thanks Pierre. Its work now.
XD
But, in fact, what I realy need is that the “ExtraInfo.request.getURI().toUrl()” appear in the simulation.log file. The code I am using shows the url in the terminal, but did not appear in the log file.
The list you return from extraInfoExtractor() is what gets printed (tab-delimited) in the log file. So instead of returning Nil, return List(ExtraInfo.request.getURI().toUrl())
Well, getUrl() wasn’t actually putting the request URL in the simulation log, so I was trying getURLI.toUrl() to see if I got better results. But I just looked in the asynhttpclient code, and saw that the method is getUri, not getURI as it says here, so I think I’m all set. Thanks.
I was only able to get this to work if I used a single extraInfoExtractor method. I actually want two - one for the request URL and one for the response payload size - so is there a way to do that successfully? It seems only to honor the last extraInfoExtractor listed.