/* Ċ Ġ* Ġ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 .* Ċ Ċ class ĠAssertion Sample Kotlin : ĠSimulation () Ġ{ ĊĊĠ Ġval Ġpopulation Ġ= Ġscenario (" foo "). inject Open ( at Once Users ( 1 )) Ċ Ċ init Ġ{ Ċ //# setUp Ċ setUp ( population ) ĊĠ Ġ. assertions ( ĊĠĠĠĠĠĠĠĠĠ Ġglobal (). response Time (). max (). lt ( 5 0 ), ĊĠĠĠĠĠĠĠĠĠ Ġglobal (). successful Requests (). percent (). gt ( 9 5 . 0 ) ĊĠ Ġ) Ċ //# setUp Ċ Ċ //# details Ċ details (" My Request ") Ċ //# details Ċ Ċ //# details - group Ċ details (" My Group ", Ġ" My Request ") Ċ //# details - group Ċ Ċ //# examples Ċ // ĠAssert Ġthat Ġthe Ġmax Ġresponse Ġtime Ġof Ġall Ġrequests Ġis Ġless Ġthan Ġ 1 0 0 Ġms Ċ setUp ( population ) ĊĠ Ġ. assertions ( global (). response Time (). max (). lt ( 1 0 0 )) Ċ Ċ // ĠAssert Ġthat Ġevery Ġrequest Ġhas Ġno Ġmore Ġthan Ġ 5 % Ġof Ġfailing Ġrequests Ċ setUp ( population ) ĊĠ Ġ. assertions ( for All (). failed Requests (). percent (). lte ( 5 . 0 )) Ċ Ċ // ĠAssert Ġthat Ġthe Ġpercentage Ġof Ġfailed Ġrequests Ġnamed Ġ" My Request " Ġin Ġthe Ġgroup Ġ" My Group " Ċ // Ġis Ġexactly Ġ 0 Ġ% Ċ setUp ( population ) ĊĠ Ġ. assertions ( details (" My Group ", Ġ" My Request "). failed Requests (). percent (). shouldBe ( 0 . 0 )) Ċ Ċ // ĠAssert Ġthat Ġthe Ġrate Ġof Ġrequests Ġper Ġseconds Ġfor Ġthe Ġgroup Ġ" My Group " Ċ setUp ( population ) ĊĠ Ġ. assertions ( details (" My Group "). requests Per Sec (). between ( 1 0 0 . 0 , Ġ 1 0 0 0 . 0 )) Ċ //# examples Ċ } Ċ } Ċ