上で受信されていない私は自分のローカルホスト上で実行されている春のブートサーバーをしました:8181と私は成功を収めて、それにGET要求を行うことができますし、私はプリントアウトし、ログを参照してください。のJMeterのJava API - 負荷テストの実行が、何の要求がサーバー
は、今私は、負荷テストのための概念実証を行いました。私は、JMeterのJava APIを使用して、JMeterのJava APIを使用してSpringブートサーバーに要求を送信しています。 JMeterはテストスイートを実行しますが、エラーは報告されませんが、私のサーバー上では受信リクエストはありません。
ここで私が使用している負荷テストコードは次のとおりです。
public class Main {
public static void main(String... args) {
// Engine
StandardJMeterEngine jm = new StandardJMeterEngine();
JMeterUtils.setJMeterHome("C:\\Users\\daz\\Desktop\\apache-jmeter-3.2");
// jmeter.properties
String jmeterProperties = Main.class.getClassLoader().getResource("jmeter.properties").toString().replace("file:", "");
JMeterUtils.loadJMeterProperties(jmeterProperties);
HashTree hashTree = new HashTree();
// HTTP Sampler
HTTPSampler httpSampler = new HTTPSampler();
httpSampler.setDomain("localhost");
httpSampler.setPort(8181);
httpSampler.setPath("/job/test");
httpSampler.setMethod("GET");
// Loop Controller
LoopController loopController = new LoopController();
loopController.setLoops(1);
loopController.addTestElement(httpSampler);
loopController.setFirst(true);
loopController.initialize();
// Thread Group
SetupThreadGroup threadGroup = new SetupThreadGroup();
threadGroup.setNumThreads(2);
threadGroup.setRampUp(1);
threadGroup.setSamplerController(loopController);
// Test plan
TestPlan testPlan = new TestPlan("MY TEST SUITE");
// Construct Test Plan from previously initialized elements
hashTree.add("testPlan", testPlan);
hashTree.add("loopController", loopController);
hashTree.add("threadGroup", threadGroup);
hashTree.add("httpSampler", httpSampler);
jm.configure(hashTree);
jm.run();
}
}
は、誰かが私の予想通り、このコードは、要求を行っていないとして、ここで間違っ/欠けているものを見つけるのに役立つことはできますか?
------------- ------------- EDIT
Summariser
を使用して、私は次のような出力が得られます。
要約=午前0時00分00秒0 = ******/sの平均:0最小: 9223372036854775807最大:-9223372036854775808エラー:私は意味すると考えている0(0.00%)
私が疑っていたように、どこに要求がないのか。このすべてのものから離れて
hashTree.add(testPlan);
HashTree threadGroupHashTree = hashTree.add(testPlan, threadGroup);
threadGroupHashTree.add(httpSampler);
多かれ少なかれ正常に見える: