/* Ċ Ġ* ĠCopyright Ġ 2 0 1 1 - 2 0 2 1 ĠG at ling Cor p Ġ( https :// gat ling . io ) Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* Ġ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ Ċ import Ġio . gat ling . java api . core .* Ċ import Ġio . gat ling . java api . core . Core Dsl .* Ċ import Ġio . gat ling . java api . http . Http Dsl .* Ċ Ċ class ĠConcept Sample Kotlin : ĠSimulation () Ġ{ ĊĊĠ Ġinit Ġ{ Ċ //# dsl - bad Ċ for Ġ( i Ġin Ġ 1 .. 5 ) Ġ{ ĊĠ Ġhttp (" Access ĠGithub "). get (" https :// github . com ") Ċ } Ċ //# dsl - bad Ċ Ċ //# dsl - immutable Ċ val Ġrequest 1 Ġ= Ġhttp (" Access ĠGithub "). get (" https :// github . com ") Ċ // Ġrequest 1 Ġis Ġleft Ġunchanged Ċ val Ġrequest 2 Ġ= Ġrequest 1 . header (" accept - encoding ", Ġ" gzip ") Ċ //# dsl - immutable Ċ Ċ //# simple - scenario Ċ scenario (" Standard ĠUser ") ĊĠ Ġ. exec ( http (" Access ĠGithub "). get (" https :// github . com ")) ĊĠ Ġ. pause ( 2 , Ġ 3 ) ĊĠ Ġ. exec ( http (" Search Ġfor Ġ' gat ling ' "). get (" https :// github . com / search ? q = gat ling ")) ĊĠ Ġ. pause ( 2 ) Ċ //# simple - scenario Ċ Ċ //# example - definition Ċ val Ġstd User Ġ= Ġscenario (" Standard ĠUser ") Ġ// Ġetc .. Ċ val Ġadm User Ġ= Ġscenario (" Admin ĠUser ") Ġ// Ġetc .. Ċ val Ġadv User Ġ= Ġscenario (" Advanced ĠUser ") Ġ// Ġetc .. Ċ Ċ setUp ( ĊĠ Ġstd User . inject Open ( at Once Users ( 2 0 0 0 )), ĊĠ Ġadm User . inject Open ( nothing For ( 6 0 ), Ġr amp Users ( 5 ). during ( 4 0 0 )), ĊĠ Ġadv User . inject Open ( ramp Users ( 5 0 0 ). during ( 2 0 0 )) Ċ ) Ċ //# example - definition ĊĠ Ġ} Ċ } Ċ