@Test public void testStopTest() { System.out.println("stopTest"); VariableThroughputTimer instance = new VariableThroughputTimer(); instance.stopTest(); }
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(); } }
VariableThroughputTimer extends AbstractTestElement implements Timer, NoThreadClone, TestStateListener { 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(); } } }
VariableThroughputTimer extends AbstractTestElement implements Timer, NoThreadClone, TestStateListener { 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(); } } VariableThroughputTimer(); }
VariableThroughputTimer extends AbstractTestElement implements Timer, NoThreadClone, TestStateListener { 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(); } } VariableThroughputTimer(); synchronized long delay(); void setData(CollectionProperty rows); JMeterProperty getData(); Pair<Double, Long> getRPSForSecond(final double elapsedSinceStartOfTestSec); @Override void testStarted(); @Override void testStarted(String string); @Override void testEnded(); @Override void testEnded(String string); }
VariableThroughputTimer extends AbstractTestElement implements Timer, NoThreadClone, TestStateListener { 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(); } } VariableThroughputTimer(); synchronized long delay(); void setData(CollectionProperty rows); JMeterProperty getData(); Pair<Double, Long> getRPSForSecond(final double elapsedSinceStartOfTestSec); @Override void testStarted(); @Override void testStarted(String string); @Override void testEnded(); @Override void testEnded(String string); static final String DATA_PROPERTY; static final int DURATION_FIELD_NO; static final int FROM_FIELD_NO; static final int TO_FIELD_NO; }