0
私は、私のWebアプリケーションに対して実行したいいくつかの使用パターンをモデル化しました。私がやりたいことは、そのパターンを1週間繰り返します。私はこれを行うためのものの適切な組み合わせを見つけることができませんでした。ガトリング注入をループする方法は?
val scn: ScenarioBuilder = scenario("Issue Cert Request")
.exec(http("enroll_child_actor").post("/v1/actor/enroll")
.body(StringBody(session => createRequestActorBody(getActorId(session.userId))))
.header("Content-Type","text/plain")
.header("Authorization", jwt => "ID " + TokenGenerator.get().generateOneTimeUseToken(uberActorSubjectName, Array("ots"), "http://localhost",
uberActorPrivateKey, uberActorIdentityCert).getEncoded)
.check(jsonPath("$.identityCertificate").saveAs("childIdCert"),
jsonPath("$.secureEndpointCertificate").saveAs("childEndpointCert")
)
).exec(http("request_secure_endpoint_certificate").post("/v1/cert/issue")
.body(StringBody(createRequestCertBodySecureEndpoint))
.header("Content-Type","text/plain")
.header("Authorization", session => "ID " + TokenGenerator.get.generateTokenForActor(s"CN=http://localhost,UID=ots:${getActorId(session.userId)}", actorSecureEndpointKeyPair.getPrivate, CaCryptoUtils.certFromPemText(session.get("childEndpointCert")
.as[String])).getEncoded)
).exec(http("request_identity_certificate").post("/v1/cert/issue")
.body(StringBody(createRequestCertBodySecureEndpoint))
.header("Content-Type","text/plain")
.header("Authorization", session => "ID " + TokenGenerator.get.generateTokenForActor(s"CN=http://localhost,UID=ots:${getActorId(session.userId)}", actorIdentityKeyPair.getPrivate, CaCryptoUtils.certFromPemText(session.get("childIdCert").as[String]))
.getEncoded)
)
これは私のテストが実行される場所で、これらの手順は繰り返したいものです。私はシナリオ自体(上記)に繰り返しを入れてみましたが、それはsession.userId重複し、私がテストしているアプリケーションでエラーが出るようにセッションを繰り返すように見える(私はそれを使用しているフィールドは一意でなければならない)。
setUp {
scn.inject(nothingFor(4 seconds),
rampUsersPerSec(2) to usersMax during(durationAtMaxInSecs seconds),
constantUsersPerSec(usersConstant) during(durationAtLowerInSecs seconds),
nothingFor(3000 seconds)
).protocols(httpConf)
}
注射を何度もコピーして貼り付けていないと、指定した回数繰り返すことができますか?うまくいけば、以下のあなたが探しているものと非常によく似
感謝を!私はこれを試してみましょう。 – drusolis