private void sendBatch() throws RemoteException { if (!sampleStore.isEmpty()) { listener.processBatch(sampleStore); sampleStore.clear(); sampleTable.clear(); sampleCount = 0; } }
@Override public void sampleOccurred(SampleEvent e) { try { listener.sampleOccurred(e); } catch (RemoteException err) { log.error("RemoteException while handling sample occurred event.", err); // $NON-NLS-1$ } }
@Override public void sampleStarted(SampleEvent e) { try { listener.sampleStarted(e); } catch (RemoteException err) { log.error("RemoteException while handling sample started event.", err); // $NON-NLS-1$ } }
@Override public void testEnded(String host) { log.info("Test Ended on {}", host); try { for (SampleEvent se : sampleStore) { listener.sampleOccurred(se); } listener.testEnded(host); sampleStore.clear(); } catch (Error | RuntimeException ex) { // NOSONAR We want to have errors logged in log file log.error("testEnded(host)", ex); throw ex; } catch (Exception ex) { log.error("testEnded(host)", ex); } }
/** * Checks if any sample events are still present in the sampleStore and * sends them to the listener. Informs the listener of the testended. * * @param host * the host that the test has ended on. */ @Override public void testEnded(String host) { log.info("Test Ended on {}", host); try { if (!sampleStore.isEmpty()) { listener.processBatch(sampleStore); sampleStore.clear(); } listener.testEnded(host); } catch (RemoteException err) { log.error("testEnded(host)", err); } }
@Override public void testEnded() { try { listener.testEnded(); } catch (Exception ex) { log.error("Exception on testEnded.", ex); // $NON-NLS-1$ } }
@Override public void testStarted() { try { listener.testStarted(); } catch (Exception ex) { log.error("Exception on testStarted.", ex); // $NON-NLS-1$ } }
@Override public void sampleStopped(SampleEvent e) { try { listener.sampleStopped(e); } catch (RemoteException err) { log.error("RemoteException while handling sample stopped event.", err); // $NON-NLS-1$ } } }
if (obj instanceof SampleEvent) { try { listener.sampleOccurred((SampleEvent) obj); } catch (RemoteException err) { if (err.getCause() instanceof java.net.ConnectException){ } finally { try { listener.testEnded(host); } catch (RemoteException e) { log.error("returning sample", e);
@Override public void testEnded(String host) { try { listener.testEnded(host); } catch (Exception ex) { log.error("Exception on testEnded on host {}", host, ex); // $NON-NLS-1$ } }
@Override public void testStarted(String host) { try { listener.testStarted(host); } catch (Exception ex) { log.error("Exception on testStarted on host {}", host, ex); // $NON-NLS-1$ } }
@Override public void sampleStopped(SampleEvent e) { log.debug("Sample stopped"); try { listener.sampleStopped(e); } catch (RemoteException err) { log.error("sampleStopped", err); } } }
@Override public void testEnded(String host) { log.info("Test Ended on {}", host); try { listener.testEnded(host); } catch (RemoteException ex) { log.warn("testEnded(host)", ex); } }
@Override public void testStarted() { log.debug("Test Started()"); try { listener.testStarted(); } catch (Error | RuntimeException ex) { // NOSONAR We want to have errors logged in log file log.error("testStarted()", ex); throw ex; } catch (Exception ex) { log.error("testStarted()", ex); } }
@Override public void sampleOccurred(SampleEvent e) { try { listener.sampleOccurred(e); } catch (RemoteException err) { if (err.getCause() instanceof java.net.ConnectException){ throw new JMeterError("Could not return sample",err); } log.error("sampleOccurred", err); } }
try { log.debug("Firing sample"); listener.processBatch(clonedStore); clonedStore.clear(); } catch (RemoteException err) {
@Override public void sampleStarted(SampleEvent e) { log.debug("Sample started"); try { listener.sampleStarted(e); } catch (RemoteException err) { log.error("sampleStarted", err); } }
@Override public void testEnded(String host) { log.debug("Test Ended on {}", host); try { listener.testEnded(host); queue.put(FINAL_EVENT); } catch (Exception ex) { log.warn("testEnded(host)", ex); } if (queueWaits > 0) { log.info("QueueWaits: {}; QueueWaitTime: {} (nanoseconds)", queueWaits, queueWaitTime); } }
@Override public void testStarted(String host) { log.debug("Test Started on {}", host); try { listener.testStarted(host); } catch (Error | RuntimeException ex) { // NOSONAR We want to have errors logged in log file log.error("testStarted(host) on {}", host, ex); throw ex; } catch(Exception ex) { log.error("testStarted(host) on {}", host, ex); } }
@Override public void sampleOccurred(SampleEvent event) { //Strip the response data before writing, but only for a successful request. SampleResult result = event.getResult(); if(stripAlsoOnError || result.isSuccessful()) { // Compute bytes before stripping stripResponse(result); // see Bug 57449 for (SampleResult subResult : result.getSubResults()) { stripResponse(subResult); } } if(decoratedSender == null) { try { listener.sampleOccurred(event); } catch (RemoteException e) { log.error("Error sending sample result over network", e); } } else { decoratedSender.sampleOccurred(event); } }