private void notifyListeners(List<SampleListener> listeners, SampleResult result) { SampleEvent event = new SampleEvent(result, threadGroup.getName(), threadVars); notifier.notifyListeners(event, listeners); }
@Override public void notifyListeners(SampleEvent res, List<SampleListener> listeners) { log.debug("Adding subresult " + res.getResult()); SampleResult result = res.getResult(); String label = result.getSampleLabel(); synchronized (this) { container.addSubResult(result); if (!res.getResult().isSuccessful()) { container.setSuccessful(false); } } // because https://bz.apache.org/bugzilla/show_bug.cgi?id=62550 in JMeter 5.0 result.setSampleLabel(label); super.notifyListeners(res, listeners); log.debug("Added subresult " + res.getResult()); }
/** * Create additional SampleEvent in NON Parent Mode */ protected void notifyListeners() { // TODO could these be done earlier (or just once?) JMeterContext threadContext = getThreadContext(); JMeterVariables threadVars = threadContext.getVariables(); SamplePackage pack = (SamplePackage) threadVars.getObject(JMeterThread.PACKAGE_OBJECT); if (pack == null) { // If child of TransactionController is a ThroughputController and TPC does // not sample its children, then we will have this // TODO Should this be at warn level ? log.warn("Could not fetch SamplePackage"); } else { SampleEvent event = new SampleEvent(res, threadContext.getThreadGroup().getName(),threadVars, true); // We must set res to null now, before sending the event for the transaction, // so that we can ignore that event in our sampleOccured method res = null; lnf.notifyListeners(event, pack.getSampleListeners()); } }