@Override public SamplePackage configureSampler(Sampler sampler) { SamplePackage samplePackage = super.configureSampler(sampler); addSamplePackage(sampler, samplePackage); if (suppressListeners) { samplePackage.getSampleListeners().clear(); } return samplePackage; }
@Override public SamplePackage configureTransactionSampler(TransactionSampler transactionSampler) { SamplePackage samplePackage = super.configureTransactionSampler(transactionSampler); addSamplePackage(transactionSampler, samplePackage); if (suppressListeners) { samplePackage.getSampleListeners().clear(); } return samplePackage; }
private void saveTransactionControllerConfigs(TransactionController tc) { List<ConfigTestElement> configs = new LinkedList<>(); List<Controller> controllers = new LinkedList<>(); List<SampleListener> listeners = new LinkedList<>(); List<Timer> timers = new LinkedList<>(); List<Assertion> assertions = new LinkedList<>(); LinkedList<PostProcessor> posts = new LinkedList<>(); LinkedList<PreProcessor> pres = new LinkedList<>(); for (int i = stack.size(); i > 0; i--) { addDirectParentControllers(controllers, stack.get(i - 1)); for (Object item : testTree.list(stack.subList(0, i))) { if (item instanceof SampleListener) { listeners.add((SampleListener) item); } if (item instanceof Assertion) { assertions.add((Assertion) item); } } } SamplePackage pack = new SamplePackage(configs, listeners, timers, assertions, posts, pres, controllers); pack.setSampler(new TransactionSampler(tc, tc.getName())); pack.setRunningVersion(true); transactionControllerConfigMap.put(tc, pack); }
trackIterationListeners(stack); if (child instanceof Sampler) { saveSamplerConfigs((Sampler) child); saveTransactionControllerConfigs((TransactionController) child);
SamplePackage pack = compiler.configureSampler(current); runPreProcessors(pack.getPreProcessors()); notifyListeners(sampleListeners, result); compiler.done(pack); compiler.done(pack); // Finish up
/** * Configures sampler from SamplePackage extracted from Test plan and returns it * @param sampler {@link Sampler} * @return {@link SamplePackage} */ public SamplePackage configureSampler(Sampler sampler) { SamplePackage pack = samplerConfigMap.get(sampler); pack.setSampler(sampler); configureWithConfigElements(sampler, pack.getConfigs()); return pack; }
test.traverse(postSearcher); TestCompiler.initialize();
public JMeterThread(HashTree test, JMeterThreadMonitor monitor, ListenerNotifier note) { this.monitor = monitor; threadVars = new JMeterVariables(); testTree = test; compiler = new TestCompiler(testTree); threadGroupLoopController = (Controller) testTree.getArray()[0]; SearchByClass<TestIterationListener> threadListenerSearcher = new SearchByClass<>(TestIterationListener.class); // TL - IS test.traverse(threadListenerSearcher); testIterationStartListeners = threadListenerSearcher.getSearchResults(); SearchByClass<SampleMonitor> sampleMonitorSearcher = new SearchByClass<>(SampleMonitor.class); test.traverse(sampleMonitorSearcher); sampleMonitors = sampleMonitorSearcher.getSearchResults(); notifier = note; running = true; }
private SampleResult doEndTransactionSampler( TransactionSampler transactionSampler, Sampler parent, SamplePackage transactionPack, JMeterContext threadContext) { // Get the transaction sample result SampleResult transactionResult = transactionSampler.getTransactionResult(); transactionResult.setThreadName(threadName); transactionResult.setGroupThreads(threadGroup.getNumberOfThreads()); transactionResult.setAllThreads(JMeterContextService.getNumberOfThreads()); // Check assertions for the transaction sample checkAssertions(transactionPack.getAssertions(), transactionResult, threadContext); // Notify listeners with the transaction sample result if (!(parent instanceof TransactionSampler)) { notifyListeners(transactionPack.getSampleListeners(), transactionResult); } compiler.done(transactionPack); return transactionResult; }
SamplePackage transactionPack = compiler.configureTransactionSampler(transactionSampler); doEndTransactionSampler(transactionSampler, null, transactionPack, threadContext);
LinkedList<PreProcessor> pres = new LinkedList<>(); for (int i = stack.size(); i > 0; i--) { addDirectParentControllers(controllers, stack.get(i - 1)); List<PreProcessor> tempPre = new LinkedList<>(); List<PostProcessor> tempPost = new LinkedList<>();
if (current instanceof TransactionSampler) { transactionSampler = (TransactionSampler) current; transactionPack = compiler.configureTransactionSampler(transactionSampler);