# Scénario : get the limit of my web socket with a condition: 90% of the requests should be ok

**URL:** <https://community.gatling.io/t/scenario-get-the-limit-of-my-web-socket-with-a-condition-90-of-the-requests-should-be-ok/7083>\
**Category:** Gatling (Open-Source)\
**Tags:** gatling-academy\
**Created:** [August 18, 2022, 8:45pm UTC](https://community.gatling.io/t/scenario-get-the-limit-of-my-web-socket-with-a-condition-90-of-the-requests-should-be-ok/7083 "2022-08-18T20:45:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nassereddine\_belghit](https://avatars.discourse-cdn.com/v4/letter/n/df705f/32.png) [@nassereddine\_belghit](https://community.gatling.io/u/nassereddine_belghit)\
**Post date:** [August 18, 2022, 8:45pm UTC](https://community.gatling.io/t/scenario-get-the-limit-of-my-web-socket-with-a-condition-90-of-the-requests-should-be-ok/7083/1 "2022-08-18T20:45:41Z")

</div>

Hello,  
I want to get the limit of the number of possible requests/sec on my web socket with 90 % of requests must be ok , ok for me is that the response time must be less than 3 seconds.  
I am not able to build my scenario, I tried the assertions however it made my build fail.  
Any hep to concept such a scenario please.  
Thank you

---

<div class="post-metadata">

**Author:** ![shoaib42](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/shoaib42/32/844_2.png) [@shoaib42](https://community.gatling.io/u/shoaib42)\
**Post date:** [August 19, 2022, 3:02pm UTC](https://community.gatling.io/t/scenario-get-the-limit-of-my-web-socket-with-a-condition-90-of-the-requests-should-be-ok/7083/2 "2022-08-19T15:02:58Z")

</div>

Can you provide a sample of your code. It helps the community help you better.

From what I can see here, is that you will need to ramp up your load slowly, and have the assertion that are described here [Gatling - Assertions](https://gatling.io/docs/gatling/reference/current/core/assertions/#concepts)

```auto
//scala
setUp(
  myScenario.inject(
      rampUsersPerSec(10).to(20).during(10.minutes) // you will need to change this according to your load
  ).protocols(httpProtocol)
 )
  .assertions(
    global.responseTime.max.lt(3000),
    global.successfulRequests.percent.gt(90)
  )

//java
setUp(
  myScenario.injectOpen(
    rampUsersPerSec(10).to(20).during(10.minutes) // you will need to change this according to your load
  ).protocols(httpProtocol)
 )
 .assertions(
     global().responseTime().max().lt(3000),
     global().successfulRequests().percent().gt(90.0)
  );

```

---

<div class="post-metadata">

**Author:** ![nassereddine\_belghit](https://avatars.discourse-cdn.com/v4/letter/n/df705f/32.png) [@nassereddine\_belghit](https://community.gatling.io/u/nassereddine_belghit)\
**Post date:** [December 9, 2022, 3:23pm UTC](https://community.gatling.io/t/scenario-get-the-limit-of-my-web-socket-with-a-condition-90-of-the-requests-should-be-ok/7083/3 "2022-12-09T15:23:26Z")

</div>

Thanks [shoaib42](https://community.gatling.io/u/shoaib42) for your answer however adding assertions will block report generation

---

<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:** [December 9, 2022, 3:37pm UTC](https://community.gatling.io/t/scenario-get-the-limit-of-my-web-socket-with-a-condition-90-of-the-requests-should-be-ok/7083/4 "2022-12-09T15:37:44Z")

</div>

> however adding assertions will block report generation

No it won’t.
