Ungayibeka njani Parameterize ukuGuquguquka kwezinto

Singazenza njani iiparameter Gatling eziguquguqukayo kunye nokudlula iiparameter ukusuka kumgca wokuyalela ukuya kwiGatling? Ngamaxesha amaninzi, xa usenza iskripthi sentsebenzo, ufuna ukulingisa ngeseti yeeparameter ezahlukeneyo, ezinje ngabasebenzisi, ixesha lokunyuka kunye nexesha, okanye indawo eyahlukileyo.

Kule Gatling tutorial, siya kuba sisebenzisa iMaven njengesixhobo sokwakha kwaye sibonise indlela yokwenza uvavanyo kuvavanyo ukuze sikwazi ukudlula amaxabiso awahlukeneyo kumgca wokuyalela okanye isixhobo seCI esinjengeJenkins kwiklasi yethu yokulinganisa.



Parameterize ukuShukuma okuguqukayo

Kuqala, kufuneka sibe noku kulandelayo kwicandelo lokwakha lefayile ye-pom.xml






io.gatling
gatling-maven-plugin
${gatling-plugin.version}


simulations.LoginSimulation



-Denv=stable

-Dusers=${users}

-Drampup=${rampup}

-Dduration=${duration}

-Dthroughput=${throughput}

-Xms2g

-Xmx5g



true


Ke kwinto yoqwalaselo, sinokubhekisa koku kungasentla ngentla ukujova amaxabiso agqithiselwe kumgca wokuyalela:

object Configuration { val t_concurrency = Integer.getInteger('users', 10).toInt val t_rampUp = Integer.getInteger('rampup', 1).toInt val t_holdFor = Integer.getInteger('duration', 60).toInt val t_throughput = Integer.getInteger('throughput', 100).toInt }

Ukuba umsebenzisi akaboneleli ngexabiso kwizinto eziguquguqukayo, emva koko kusetyenziswa amaxabiso asisiseko. Umzekelo, ixabiso elisisiseko labasebenzisi li-10.


Nje ukuba sisete apha ngasentla, emva koko sinokusebenzisa umgca wokuyalela okanye isixhobo se-CI ukudlulisa iiparameter kwifayile ye-pom.xml ethi yona ibajoje kwiklasi yokulinganisa.

mvn clean gatling:execute -Dusers=20 -Drampup=2 -Dduration=60 -Dthroughput=100