Created
August 11, 2019 15:36
-
-
Save lacoski/45e244b267c3e1ed7f7c9777eb24c2a7 to your computer and use it in GitHub Desktop.
GatlingReports
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.concurrent.duration._ | |
import io.gatling.core.Predef._ | |
import io.gatling.http.Predef._ | |
import io.gatling.jdbc.Predef._ | |
class DemoGatlingRecorder extends Simulation { | |
val httpProtocol = http | |
.baseUrl("http://10.10.10.86") | |
.inferHtmlResources() | |
.acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3") | |
.acceptEncodingHeader("gzip, deflate") | |
.acceptLanguageHeader("en-US,en;q=0.9") | |
.userAgentHeader("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36") | |
val headers_0 = Map( | |
"Proxy-Connection" -> "keep-alive", | |
"Upgrade-Insecure-Requests" -> "1") | |
val headers_1 = Map( | |
"Accept" -> "*/*", | |
"Proxy-Connection" -> "keep-alive") | |
val scn = scenario("DemoGatlingRecorder") | |
.exec( | |
http("truy_cap_trang_chu") | |
.get("/") | |
.headers(headers_0) | |
.resources( | |
http("request_1") | |
.get("/wp-includes/js/wp-emoji-release.min.js?ver=4.9.10") | |
.headers(headers_1) | |
) | |
) | |
.pause(8) | |
.exec(http("xem_bai_viet_1") | |
.get("/index.php/2019/08/11/iphone-11-se-ra-mat-vao-10-9/") | |
.headers(headers_0)) | |
.pause(6) | |
.exec(http("tim_kiem") | |
.get("/?s=phone") | |
.headers(headers_0)) | |
.pause(7) | |
.exec(http("xem_bai_tim_kiem") | |
.get("/index.php/2019/08/11/soi-cap-nay-co-the-hack-iphone-may-tinh-cua-ban-trong-vai-phut/") | |
.headers(headers_0)) | |
.pause(5) | |
.exec(http("tro_lai_trang_chu") | |
.get("/") | |
.headers(headers_0)) | |
setUp( | |
scn.inject( | |
rampUsers(10) during(60 seconds) | |
) | |
).protocols(httpProtocol) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment