Maitiro ekuparadzanisa Gatling Variables

Tingaite sei paramende Gatling misiyano uye kupfuura maparamende kubva kune yekuraira tambo kuenda kuGatling? Pane dzimwe nguva, kana iwe ukagadzira yekuita script, iwe unoda kumhanyisa iwo simeti neakasiyana seti yemiparamende, sevashandisi, nguva yekukwirisa uye nguva, kana yakatosiyana nharaunda.

Muchidzidzo ichi cheGatling, tichave tichishandisa Maven sechishandiso chekuvaka uye tinoratidza maitiro ekuyera bvunzo kuti tikwanise kupfuudza tsika dzakasiyana kubva kumutsetse wekuraira kana chishandiso cheCI senge Jenkins kukirasi yedu yekufananidza.

Parameterize Gatling akasiyana

Kutanga, isu tinofanirwa kuve neanotevera muchikamu chekuvaka che pom.xml faira





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


simulations.LoginSimulation



-Denv=stable

-Dusers=${users}

-Drampup=${rampup}

-Dduration=${duration}

-Dthroughput=${throughput}

-Xms2g

-Xmx5g



true


Zvino muchinhu cheKushandisa, tinogona kunongedza izvo zviri pamusoro kuti ujekese tsika dzakapfuudzwa kubva mutsetse wekuraira

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 }

Kana mushandisi asingape chero kukosha kwezvakasiyana, saka zvimiro zvakasarudzika zvinoshandiswa. Semuenzaniso, iyo default kukosha kune vashandisi iri gumi.

Kana tangova nekumisikidza pamusoro, tinogona kushandisa rairo yekuraira kana kubva kuCI chishandiso kupasisa paramita kune iyo pom.xml faira iyo inozovapinza mukirasi yekuenzanisa.



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