public void mergeSamples(CorrectedResultCollector crc, List<SampleResult> samples) { SampleEvent event; try { initializeFileOutput(crc.getFilename(), crc.getSaveConfig()); } catch (IOException e) { log.warn("Error trying to initialize output file " + e.toString()); } for (SampleResult result : samples) { SampleSaveConfiguration config = crc.getSaveConfig(); event = new SampleEvent(result, null); try { if (config.saveAsXml()) { SaveService.saveSampleResult(event, out); } else { // !saveAsXml String savee = CSVSaveService .resultToDelimitedString(event); out.println(savee); } } catch (Exception err) { log.error("Error trying to record a sample", err); // should throw exception back to caller } } finalizeFileOutput(); }
public void mergeSamples(CorrectedResultCollector crc, List<SampleResult> samples) { SampleEvent event; try { initializeFileOutput(crc.getFilename(), crc.getSaveConfig()); } catch (IOException e) { log.warn("Error trying to initialize output file " + e.toString()); } for (SampleResult result : samples) { SampleSaveConfiguration config = crc.getSaveConfig(); event = new SampleEvent(result, null); try { if (config.saveAsXml()) { SaveService.saveSampleResult(event, out); } else { // !saveAsXml String savee = CSVSaveService .resultToDelimitedString(event); out.println(savee); } } catch (Exception err) { log.error("Error trying to record a sample", err); // should throw exception back to caller } } finalizeFileOutput(); }
/** * When a test result is received, display it and save it. * * @param event * the sample event that was received */ @Override public void sampleOccurred(SampleEvent event) { SampleResult result = event.getResult(); if (isSampleWanted(result.isSuccessful())) { sendToVisualizer(result); if (out != null && !isResultMarked(result) && !this.isStats) { SampleSaveConfiguration config = getSaveConfig(); result.setSaveConfig(config); try { if (config.saveAsXml()) { SaveService.saveSampleResult(event, out); } else { // !saveAsXml CSVSaveService.saveSampleResult(event, out); } } catch (Exception err) { log.error("Error trying to record a sample", err); // should throw exception back to caller } } } if(summariser != null) { summariser.sampleOccurred(event); } }