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)