Latency calculation

Hi STephane,

I am using the latest Gatling release ie, snapshot release. I have two httpprotocols for a single simulation. one will be receiving the request from the other httpprotocol. I want to measure latency ie, time when request was sent to httpprotocol1 and time when request reached httpprotocol2. And I have used below lines:

val httpProtocol = http.baseURL(“http://xx.xx.xx.xx”).acceptHeader(“application/xml”)

.extraInfoExtractor((name,status:Status, session:Session, request:Request, response: Response) => {




val httpProt = http.baseURL(“http://yy.yy.yy.yy”).acceptHeader(“application/xml”)

.extraInfoExtractor((name,status:Status, session:Session, request:Request, response: Response) => {


println("T1 : "+t1),

println("T2 : "+t2),





Could you validate this? Because at times, am not receiving proper times. I hope response.lastByteReceived will give the time when last byte of response was received by the server.


I’m not sure I get it right. Do you mean that you have 2 populations: one that sends events, and one that gets notified and you want to measure the time the second one gets notified?

If so, you probably cannot be sure that events don’t interleave, (req1, req1, req2, req2) instead of (req1, req2, req1, req2)?
Then, how do you define t1 and t2? Those are global variables, so you have to use @volatile or AtomicLong in order to make changes visible to all threads.