protected void stopTest() { if (stopTries > 30) { throw new IllegalStateException("More than 30 retries - stopping with exception"); } if (lastStopTry == time) { return; } log.info("No further RPS schedule, asking threads to stop..."); lastStopTry = time; stopTries++; if (stopTries > 10) { log.info("Tries more than 10, stopping engine NOW!"); StandardJMeterEngine.stopEngineNow(); } else if (stopTries > 5) { log.info("Tries more than 5, shutting down engine!"); StandardJMeterEngine.stopEngine(); } else if (stopTries > 3) { AbstractThreadGroup threadGroup = JMeterContextService.getContext().getThreadGroup(); log.info("Tries more than 3, hard stopping threads of Thread Group : {}", threadGroup.getName()); threadGroup.tellThreadsToStop(); } else { AbstractThreadGroup threadGroup = JMeterContextService.getContext().getThreadGroup(); log.info("Stopping gracefuly threads of Thread Group : {}", threadGroup.getName()); threadGroup.stop(); } }
protected void stopTest() { if (stopTries > 30) { throw new RuntimeException("More than 30 seconds - stopping by exception"); } if (lastStopTry == time) { return; } log.info("No further RPS schedule, asking threads to stop..."); lastStopTry = time; stopTries++; if (stopTries > 10) { log.info("Tries more than 10, stop it NOW!"); StandardJMeterEngine.stopEngineNow(); } else if (stopTries > 5) { log.info("Tries more than 5, stop it!"); StandardJMeterEngine.stopEngine(); } else { JMeterContextService.getContext().getEngine().askThreadsToStop(); } }
@Override public void handleSampleResults(List<SampleResult> list, BackendListenerContext backendListenerContext) { if (isInterruptedThroughUI) { return; } accumulator.addAll(list); JSONObject data = JSONConverter.convertToJSON(accumulator, list); int counter = 0; while (!apiClient.isTestStarted() && counter < 3) { log.debug("Waiting for test starting"); makeDelay(); counter++; } try { apiClient.sendOnlineData(data); } catch (JMeterStopTestException ex) { isInterruptedThroughUI = true; StandardJMeterEngine.stopEngineNow(); } catch (IOException e) { log.warn("Failed to send data: " + data, e); } makeDelay(); }
private void stopTest() { stopTries++; if (JMeter.isNonGUI()) { log.info("Stopping JMeter via UDP call"); stopTestViaUDP("StopTestNow"); } else { if (stopTries > 10) { log.info("Tries more than 10, stop it NOW!"); StandardJMeterEngine.stopEngineNow(); } else if (stopTries > 5) { log.info("Tries more than 5, stop it!"); StandardJMeterEngine.stopEngine(); } else { JMeterContextService.getContext().getEngine().askThreadsToStop(); } } }
private void stopTest() { stopTries++; if (JMeter.isNonGUI()) { log.info("Stopping JMeter via UDP call"); stopTestViaUDP("StopTestNow"); } else { if (stopTries > 10) { log.info("Tries more than 10, stop it NOW!"); StandardJMeterEngine.stopEngineNow(); } else if (stopTries > 5) { log.info("Tries more than 5, stop it!"); StandardJMeterEngine.stopEngine(); } else { JMeterContextService.getContext().getEngine().askThreadsToStop(); } } }