question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Gatling 3.x miscalculate the response time in the first few seconds

See original GitHub issue

I ran the same script in both 2.3.1 and 3.1.2, the average ping to the site is under 30ms.

The result of 2.3.1 is correct, but 3.1.2 always shows that there’s “no response” in the first 3-10 seconds.


2.3.1:

================================================================================
---- Global Information --------------------------------------------------------
> request count                                        600 (OK=600    KO=0     )
> min response time                                     17 (OK=17     KO=-     )
> max response time                                    211 (OK=211    KO=-     )
> mean response time                                    25 (OK=25     KO=-     )
> std deviation                                         14 (OK=14     KO=-     )
> response time 50th percentile                         22 (OK=22     KO=-     )
> response time 75th percentile                         24 (OK=24     KO=-     )
> response time 95th percentile                         35 (OK=35     KO=-     )
> response time 99th percentile                         95 (OK=95     KO=-     )
> mean requests/sec                                     20 (OK=20     KO=-     )
---- Response Time Distribution ------------------------------------------------
> t < 800 ms                                           600 (100%)
> 800 ms < t < 1200 ms                                   0 (  0%)
> t > 1200 ms                                            0 (  0%)
> failed                                                 0 (  0%)
================================================================================


3.1.2:

================================================================================
---- Global Information --------------------------------------------------------
> request count                                        595 (OK=595    KO=0     )
> min response time                                     17 (OK=17     KO=-     )
> max response time                                   8154 (OK=8154   KO=-     )
> mean response time                                  1315 (OK=1315   KO=-     )
> std deviation                                       2367 (OK=2367   KO=-     )
> response time 50th percentile                         23 (OK=23     KO=-     )
> response time 75th percentile                       1469 (OK=1469   KO=-     )
> response time 95th percentile                       7004 (OK=7004   KO=-     )
> response time 99th percentile                       7887 (OK=7887   KO=-     )
> mean requests/sec                                 19.833 (OK=19.833 KO=-     )
---- Response Time Distribution ------------------------------------------------
> t < 800 ms                                           430 ( 72%)
> 800 ms < t < 1200 ms                                  11 (  2%)
> t > 1200 ms                                          154 ( 26%)
> failed                                                 0 (  0%)
================================================================================


script:

import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._

class Test extends Simulation {
    val httpConf = http
        .baseURL("http://www.baidu.com")  // .baseUrl in 3.x

    val scn = scenario("Demo")
        .exec(
            http("test")
                .get("/")
        )

    setUp(
        scn.inject(
            constantUsersPerSec(20).during(30.seconds).randomized,
        ).protocols(httpConf)
    )
}
  • OS: macOS 10.14.4
  • JDK: 1.8.0_u181

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
slandellecommented, Jun 3, 2019

I’ve made some changes wrt initialization order that might help, see #3745. However, the core issue was that your box wasn’t properly configured (localhost missing /etc/hosts).

0reactions
lovromazgoncommented, Jun 22, 2020

FWIW, I’m still experiencing the same issue. My /etc/hosts file already contains the mapping for localhost.

Gatling: 3.3.1 OS: macOS 10.15.5 JDK: OpenJDK 13.0.2

I’m also attaching the log output (logs.zip) generated by the script shared in this comment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

response time anomaly in simulation summary - Google Groups
I am using gatling 2.x for testing a REST api's response times. My simulation code looks as follows: ... setUp (scn.inject(rampUsers(1) over(2 seconds)))....
Read more >
How The Duration In Gatling Report Is Calculated - ADocLib
Gatling is a load and stress testing tool based on Scala and built for ... [BUG] Gatling 3.x miscalculate the response time in...
Read more >
Assertions - Gatling
The Assertions API is used to verify that global statistics, like response time or number of failed requests, match expectations for a whole...
Read more >
Response time loading is not correct - gatling - Stack Overflow
i can record the simulation through Gatling and able to run the simulation, but i am getting less load time compared to actual...
Read more >
JDK-8141210 Very slow loading of JavaScript file with ... - Bug ID
ACTUAL - The load command completes within few minutes. ... i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found