Gatling 2.0 RC2 - Gatling Reporting not reflecting actual execution

Hello Gatling Users,

I’m new to Gatling tool usage, facing issues with reports. They does not seem to reflect exact number of Users/Simulations triggered.
Could you please advise, if any corrections needed to ensure all transactions are reported in Gatling report.

Code Snippet :

class TestSimulation extends Simulation {

Object Home {

val homepage = group(“Home Page”) {

repeat(100) {

exec(http(“home page”)

.get("""/""")

.headers(headers_0)

.resources(http(“request_1”)

.get(uri1 + “”"/scripts/main.js""") ))

}

}

Object Browse {

val browsepages = group(“browse Pages”) {

repeat(50) {

exec(http(“home page”)

.get("""/""")

.headers(headers_0)

.resources( http(“search-resource”)

.get(uri1 + “”"/scripts/vendor/knockout-3.1.0.js.map""")))

}

}

val httpConf = http

.baseURL(“http://localhost:9004”)

.inferHtmlResources()

.acceptHeader("""/""")

.acceptEncodingHeader(""“gzip, deflate”"")

.acceptLanguageHeader(""“en-gb,en;q=0.5"”")

.connection(""“keep-alive”"")

.userAgentHeader(""“Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:30.0) Gecko/20100101 Firefox/30.0"”")

val headers_0 = Map(""“Accept”"" → “”“text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8"”")

val headers_23 = Map(""“Accept”"" → “”“image/png,image/;q=0.8,/*;q=0.5"”")

val headers_25 = Map(""“X-Requested-With”"" → “”“XMLHttpRequest”"")

val uri1 = “”“http://localhost:9004"”"

/* Added following step to run selected tests in sequence */

val scenario1 = scenario(“testscenario”).during(300 minutes) {exec(HomePage.home,BrowseAncillaryPages.browse,BrowseContentItems.contentItems,Search.search)}.during(300 minutes){exec(HomePage.home,BrowseAncillaryPages.browse,Search.search,BrowseContentItems.contentItems)}

setUp(

scenario1.inject(rampUsers(30) over (10 seconds)) }

Above test Executed successfully for 600 minutes, however at end of test its just showing only 60 Transactions triggered for each page Home Page, Browsing pages.

Would you please advise, if any further changes need in script to effectively report , along with each of repetitions in test script.

Thanks,

Srujana

Hi Srujana!

I’ll try and help.
Could you write down some brief sentences in plain english describing what you want the users to do in the test?

Secondary to that the team would need some more information - the code snippet does not tie together (possibly cut and paste errors but still) -

scenario1 executes HomePage.home but you have not provided the code for that - could you provide it?
Home.homepage is provided but it is not included in the scenario anywhere. We don’t know what the scenario executes therefore.

Note the note on During:
http://gatling.io/docs/2.0.0-RC2/general/scenario.html?highlight=repeat#during

"exitASAP is optional and defaults to true. If true, the condition will be evaluated for each element inside the loop, possibly causing to exit before reaching the end of the iteration."

which is possibly a source of the missing requests.

On slightly different angle:

The Gatling DSL is rich, but I would use it very sparingly [to start with] eg. :
do you need to repeat (do real users do this)?
do you need a during in the scenario?

You don’t if each user executes that sequence of requests once, then just let each user do that, don’t loop in the scenario (unless your real users do), and inject a usersPerSecond as they would arrive in real life…

http://gatling.io/docs/2.0.0-RC2/general/simulation_setup.html#injection

Hi Srujana,

Could you try adding disableCaching to your httpConf ?
It could be as simple as that your requests and their responses are cached, since the requests in your repeat blocks are strictly the same each call.

Cheers,

Pierre

Hello Alex & Pierre,

Many thanks for your response. Based on your advise, I have removed repeat statements as real user does not do this.
Apologies for sending following big mail.

I am trying to perform load test, simulating concurrent users loading test site along with its static resources (.js, .woff, .png etc …).
I am including static resources as well, as My current project does not use CDN and all static resources are downloaded from server.

Please find below myupdated code for Home page along with test report.
This seems to be giving average of HomePage Load time along with its resources.

Would you please advise if there is any approach to project total load time for Home Page with all resources, rather than average of all requests grouped under Group block.

My Updated Test code:

object HomePage {
val home =
group(“Home Page”) {
exec(http(“home page”)
.get( “”“/”“”)
.headers(headers_0)
.resources(http(“request_1”)
.get(uri1 + “”“/scripts/main.js”“”),
http(“homepage resource-glyphicons-halflings-regular.woff”)
.get(uri1 + “”“/assets/fonts/glyphicons-halflings-regular.woff”“”)
.headers(headers_0),
http(“homepage-app.js”)
.get(uri1 + “”“/scripts/app/app.js”“”),
http(“homepage-when.js”)
.get(uri1 + “”“/scripts/vendor/when/when.js”“”),
http(“homepage-FiraSans-Regular.woff”)
.get(uri1 + “”“/assets/fonts/fira/FiraSans-Regular.woff”“”)
.headers(headers_0),
http(“homepage-Homepage-FiraSans-Medium.woff”)
.get(uri1 + “”“/assets/fonts/fira/FiraSans-Medium.woff”“”)
.headers(headers_0),
http(“homepage-showdown.js”)
.get(uri1 + “”“/scripts/vendor/showdown.js”“”),
http(“homepage-aquilla”)
.get(uri1 + “”“/scripts/aquilla/edit.js”“”),
//.check(status.is(200)),
http(“homepage-request_9”)
.get(uri1 + “”“/scripts/vendor/jquery.js”“”),
http(“homepage-templates.js”)
.get(uri1 + “”“/scripts/app/templates.js”“”),
http(“homepage-jstree.js”)
.get(uri1 + “”“/scripts/vendor/jstree/jstree.js”“”),
http(“homepage-notfication.js”)
.get(uri1 + “”“/scripts/app/notification.js”“”),
http(“homepage-cookie.js”)
.get(uri1 + “”“/scripts/app/cookie.js”“”),
http(“filter.js”)
.get(uri1 + “”“/scripts/app/filter.js”“”),
http(“scripts-menu.js”)
.get(uri1 + “”“/scripts/app/menu.js”“”),
http(“guide.js”)
.get(uri1 + “”“/scripts/app/guide.js”“”),
http(“jquery-blockUI.js”)
.get(uri1 + “”“/scripts/vendor/jquery.blockUI.js”“”),
http(“edit_mock.js”)
.get(uri1 + “”“/scripts/app/edit_mock.js”“”),
http(“ICanHaz.min.js”)
.get(uri1 + “”“/scripts/vendor/ICanHaz.min.js”“”),
http(“jquery-ba-haschange.js”)
.get(uri1 + “”“/scripts/vendor/jquery.ba-hashchange.js”“”),
http(“utility.js”)
.get(uri1 + “”“/scripts/app/utility.js”“”),
http(“search.js”)
.get(uri1 + “”“/scripts/app/search.js”“”),
http(“search.png”)
.get(uri1 + “”“/assets/images/search.png”“”)
.headers(headers_23),
http(“scrollTo.min.js”)
.get(uri1 + “”“/scripts/vendor/jquery.scrollTo.min.js”“”),
http(“templates.html”)
.get(uri1 + “”“/client-templates/templates.html”“”)
.headers(headers_25),
http(“btn-chevron-right”)
.get(uri1 + “”“/assets/images/btn-chevron-right.png”“”)
.headers(headers_23)))

}
}

object ContentArticle {

val Article = {

group(“Main Section Category List”){
exec(http(“/housing/”)
.get(uri1 + “”“/housing/”“”))
.group(“Sub Sections Category list”) {
// subsection [level-2] under housing
group(“Content Item”) {
exec(http(“/housing/emergency-housing-and-temporary-accommodation/”)
.get(uri1 + “”“/housing/emergency-housing-and-temporary-accommodation/”“”))
.group(“Articles”) {
// leaf nodes [level-3] under emergency housing
exec(http(“Emergency Housing - During Flood “)
.get(uri1 + “””/how-can-i-get-for-emergency-housing-in-even-of-flood/”“”))
.exec(http(“What housing am I eligible for?”)
.get(uri1 + “”“/what-housing-am-i-eligible-for/”“”))
}
}
}

}

}

}

val scenario1 = scenario(“testscenario”).forever()(

randomSwitch(
60 → HomePage.home,
40 → ContentArticle.Article
)
)

setUp(
scenario1.inject(rampUsers(30) over (10 seconds))

).protocols(httpConf)
.maxDuration(1 minutes) // I have reduced the time for quick check

With this change, The report seems to produce aggregate of results. PFA Sample report screenshot.

Would you please advise if any approach to get actual homepage load time along with its resources.

Hello Gatling Users,

I’m new to Gatling tool usage, facing issues with reports. They does not seem to reflect exact number of Users/Simulations triggered.
Could you please advise, if any corrections needed to ensure all transactions are reported in Gatling report.

Code Snippet :

class TestSimulation extends Simulation {

Object Home {

val homepage = group(“Home Page”) {

repeat(100) {

exec(http(“home page”)

.get(“”“/”“”)

.headers(headers_0)

.resources(http(“request_1”)

.get(uri1 + “”“/scripts/main.js”“”) ))

}

}

Object Browse {

val browsepages = group(“browse Pages”) {

repeat(50) {

exec(http(“home page”)

.get(“”“/”“”)

.headers(headers_0)

.resources( http(“search-resource”)

.get(uri1 + “”“/scripts/vendor/knockout-3.1.0.js.map”“”)))

}

}

val httpConf = http

.baseURL(“http://localhost:9004”)

.inferHtmlResources()

.acceptHeader(“”“/”“”)

.acceptEncodingHeader(“”“gzip, deflate”“”)

.acceptLanguageHeader(“”“en-gb,en;q=0.5"”")

.connection(“”“keep-alive”“”)

.userAgentHeader(“”“Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:30.0) Gecko/20100101 Firefox/30.0"”")

val headers_0 = Map(“”“Accept”“” → “”“text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8"”")

val headers_23 = Map(“”“Accept”“” → “”“image/png,image/;q=0.8,/*;q=0.5"”")

val headers_25 = Map(“”“X-Requested-With”“” → “”“XMLHttpRequest”“”)

val uri1 = “”“http://localhost:9004"”"

/* Added following step to run selected tests in sequence */

val scenario1 = scenario(“testscenario”).during(300 minutes) {exec(HomePage.home,BrowseAncillaryPages.browse,BrowseContentItems.contentItems,Search.search)}.during(300 minutes){exec(HomePage.home,BrowseAncillaryPages.browse,Search.search,BrowseContentItems.contentItems)}

setUp(

scenario1.inject(rampUsers(30) over (10 seconds)) }

Above test Executed successfully for 600 minutes, however at end of test its just showing only 60 Transactions triggered for each page Home Page, Browsing pages.

Would you please advise, if any further changes need in script to effectively report , along with each of repetitions in test script.

I’m also seeing following INFO message at end of successful test execution. Not sure, if this has any impact to my test execution.
[INFO] [08/12/2014 19:04:41.563] [GatlingSystem-akka.actor.default-dispatcher-3] [akka://GatlingSystem/user/$c/$f] Message [io.gatling.http.ahc.OnCompleted] from Actor[akka://GatlingSystem/deadLetters] to Actor[akka://GatlingSystem/user/$c/$f#149850415] was not delivered. [6] dead letters encountered. This logging can be turned off or adjusted with configuration settings ‘akka.log-dead-letters’ and ‘akka.log-dead-letters-during-shutdown’.

Home Page-along with resources.docx (395 KB)

Hi Srujana, Raja,

This seems to be the same topic as Raja thread (which is ok).

can you send the details page for the “Home Page” group?

We have in you example for this web page:

the initial html http request
the “inferred resources” http requests
the “resources()” http requests

What seems to be happening is that the response time of the inferredResources is not captured in the response time reported on the “global” page. It is only, as far as I can see, reported in the details page at the bottom in the “Group Duration Distribution” chart. You may have to hover over the bars to view the response time

the “resources()” http requests are not captured in the group at all, as far as I can see, even though they are enclosed by the group.

Thanks,
Alex

Hi Srujana,

Some other aspects to consider :

The same comment as I made to Raja, around scenario looping and how users are injected.
“simulating concurrent users loading test site”

It’s not precise enough to determine how your users should be injected.You need to justify the choice of “rampUsers” rather than selecting arbitrarily/randomly between {“rampUsers”,“rampUsersPerSec”}

We need to determine what type of users they are:

  1. acting independently, visiting once only, from a population of users “out there” arriving at the site at a certain rate? or,
  2. a fixed number, individually identifiable (“Bob”, “Clara”, etc), repeat the scenarios over and over, possibly call center or admin staff?

if (1) select rampUsersPerSec , else (2) select rampUsers
Both will provoke concurrent usage of the site.

Also, you need to check the outcome of the switch statement. Let’s assume the users are type (2).
Do you want the switch statement to provoke 60% of requests to be home page and 40% content?
This assumes that both scenarios have exactly the same duration (unlikely in practice).
If the durations differ significantly the %age split in throughput will not be 60/40.

finally you could make the main simulation more readable/maintainable by extracting the requests out to vars:

var main_js = http(“request_1”)
.get(uri1 + “”"/scripts/main.js""")

var glyphicons-halflings-regular_woff = http(“homepage resource-glyphicons-halflings-regular.woff”)
.get(uri1 + “”"/assets/fonts/glyphicons-halflings-regular.woff""")
.headers(headers_0)

object HomePage {
val home =
group(“Home Page”) {

exec(http(“home page”)
.get( “”"/""")
.headers(headers_0)
.resources(
main_js,
glyphicons-halflings-regular_woff,

this might be automated in a later release eg similar to:
https://github.com/ceeaspb/gatling/blob/issue_1861/gatling-recorder/src/test/resources/template/navigations.txt

thanks,
Alex