# Gatling reports incorrect performance results for Websocket app

**URL:** <https://community.gatling.io/t/gatling-reports-incorrect-performance-results-for-websocket-app/2525>\
**Category:** Gatling (Open-Source)\
**Created:** [September 11, 2015, 11:40pm UTC](https://community.gatling.io/t/gatling-reports-incorrect-performance-results-for-websocket-app/2525 "2015-09-11T23:40:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Slavik\_Fursov](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Slavik\_Fursov](https://community.gatling.io/u/Slavik_Fursov)\
**Post date:** [September 11, 2015, 11:40pm UTC](https://community.gatling.io/t/gatling-reports-incorrect-performance-results-for-websocket-app/2525/1 "2015-09-11T23:40:37Z")

</div>

Using Gatling 2.1.7 to test performance of our application.  
Scenario:

1. app send the query
2. server starts responding with partial data every few seconds
3. after some time server sends complete dataset, which has “completion”:1.0,“data”

So, when I do these steps manually (In Chrome WebSocket app), I’m see, that query is completed in 28 seconds:

[http://slavikca.myds.me/Files/forums/direct.txt](http://slavikca.myds.me/Files/forums/direct.txt)

But when I do same thing in Gatling, I’m getting **198 seconds** :  
[http://slavikca.myds.me/Files/forums/gatling.txt](http://slavikca.myds.me/Files/forums/gatling.txt)

Here is part of the script:

```auto
  val completeString:String = """.*"completion":1\.0,"data":.*"""

  val httpConf = http
    .wsBaseURL(endpoint)

  val scn = scenario("WebSocket")
    .exec(ws("Connect WS").open(""))
    .exec(ws("Sending query")
           .sendText(session => optimizeQuery())
           .check(wsAwait.within(300).until(1).regex(completeString).saveAs("SiftOutput"))
    )
    .exec{ session =>
        session("SiftOutput").asOption[String].foreach(println)
        session
        }
    .exec(ws("Close WS").close)

  //setUp(scn.inject(rampUsers(users) over (2 seconds)).protocols(httpConf))
  setUp(scn.inject(atOnceUsers(1)).protocols(httpConf))
}

```

Why results would be so wrong in Gatling?

---

<div class="post-metadata">

**Author:** ![Slavik\_Fursov](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Slavik\_Fursov](https://community.gatling.io/u/Slavik_Fursov)\
**Post date:** [September 11, 2015, 11:49pm UTC](https://community.gatling.io/t/gatling-reports-incorrect-performance-results-for-websocket-app/2525/2 "2015-09-11T23:49:23Z")

</div>

The run above has WebSocket timeout.

So, I repeated steps with smaller query.  
And got same results, but without timeout:  
18 Seconds for manual tests:

[http://slavikca.myds.me/Files/forums/direct2.txt](http://slavikca.myds.me/Files/forums/direct2.txt)

But when I do same thing in Gatling, I’m getting **88 seconds** :  
[http://slavikca.myds.me/Files/forums/gatling2.txt](http://slavikca.myds.me/Files/forums/gatling2.txt)

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [February 26, 2016, 11:07am UTC](https://community.gatling.io/t/gatling-reports-incorrect-performance-results-for-websocket-app/2525/3 "2016-02-26T11:07:44Z")

</div>

No idea. Would need to be able to get my hands on a reproducer to be able to investigate.
