# Websocket response time

**URL:** <https://community.gatling.io/t/websocket-response-time/2154>\
**Category:** Gatling (Open-Source)\
**Created:** [March 30, 2015, 7:36am UTC](https://community.gatling.io/t/websocket-response-time/2154 "2015-03-30T07:36:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jamie](https://avatars.discourse-cdn.com/v4/letter/j/aca169/32.png) [@Jamie](https://community.gatling.io/u/Jamie)\
**Post date:** [March 30, 2015, 7:36am UTC](https://community.gatling.io/t/websocket-response-time/2154/1 "2015-03-30T07:36:22Z")

</div>

Hi,

I have the following script:

val httpProtocol = http  
.baseURL(“[http://chatappserver.cloudapp.net:4000](http://chatappserver.cloudapp.net:4000)”)  
.wsBaseURL(“ws://chatappserver.cloudapp.net:8080”)

val startTime = System.currentTimeMillis  
val proposedEndTime = System.currentTimeMillis + (10_60_1000)

val scn = scenario(“ConnectingToChatServer”)  
.exec(session =\> session.set(“proposedEndTime”, proposedEndTime))  
.exec(session =\> session.set(“currentUser”, “SampleUser” + userCount.getAndIncrement))  
.group(“UserConnecting”){  
exec(ws(“OpenConnection”).open("/uname=${currentUser}")  
.check(wsAwait.within(30).until(1).regex("""{._“messageType”:“presenceCountIncrement”,“username”:"${currentUser}"._}"""))).exitHereIfFailed  
}  
//remain connected  
.asLongAs(session =\> proposedEndTime \> System.currentTimeMillis) {  
pause(1)  
}

So I am finding problems interpreting the results. Which graph shows me the time it takes for the user to connect and receive the message in the regex? I mean the response time chart in index.html shows that the response time never exceeds approx 400 ms however the charts in the UserConnecting section (Duration) shows completely other values.

Can you please help me interpreting this? Attached please find the result.

Thank you.

Jamie

[Result.zip](https://community.gatling.io/uploads/short-url/ksaiHW2LzoazfDP0JEK8RjZ8jEY.zip) (386 KB)

---

<div class="post-metadata">

**Author:** ![Jamie](https://avatars.discourse-cdn.com/v4/letter/j/aca169/32.png) [@Jamie](https://community.gatling.io/u/Jamie)\
**Post date:** [March 30, 2015, 2:05pm UTC](https://community.gatling.io/t/websocket-response-time/2154/2 "2015-03-30T14:05:48Z")

</div>

Does anyone have any idea on this because I am really stuck? Please.

Thank you.

---

<div class="post-metadata">

**Author:** ![Jamie](https://avatars.discourse-cdn.com/v4/letter/j/aca169/32.png) [@Jamie](https://community.gatling.io/u/Jamie)\
**Post date:** [March 30, 2015, 2:11pm UTC](https://community.gatling.io/t/websocket-response-time/2154/3 "2015-03-30T14:11:01Z")

</div>

I am interested in knowing the time it takes to create the connection, upgrade it to websocket and receive the message.

Thank you
