private static void writeFileEnd(PrintWriter pw, SampleSaveConfiguration saveConfig) { if (saveConfig.saveAsXml()) { pw.print("\n"); // $NON-NLS-1$ pw.print(TESTRESULTS_END); pw.print("\n");// Added in version 1.1 // $NON-NLS-1$ } }
private static void writeFileEnd(PrintWriter pw, SampleSaveConfiguration saveConfig) { if (saveConfig.saveAsXml()) { pw.print("\n"); pw.print(TESTRESULTS_END); pw.print("\n");// Added in version 1.1 } }
private static void writeFileEnd(PrintWriter pw, SampleSaveConfiguration saveConfig) { if (saveConfig.saveAsXml()) { pw.print("\n"); pw.print(TESTRESULTS_END); pw.print("\n");// Added in version 1.1 } }
private static void writeFileStart(PrintWriter writer, SampleSaveConfiguration saveConfig) { if (saveConfig.saveAsXml()) { writer.print(XML_HEADER); // Write the EOL separately so we generate LF line ends on Unix and Windows writer.print("\n"); // $NON-NLS-1$ String pi=saveConfig.getXmlPi(); if (pi.length() > 0) { writer.println(pi); } // Can't do it as a static initialisation, because SaveService // is being constructed when this is called writer.print(TESTRESULTS_START_V1_1_PREVER); writer.print(SaveService.getVERSION()); writer.print(TESTRESULTS_START_V1_1_POSTVER); // Write the EOL separately so we generate LF line ends on Unix and Windows writer.print("\n"); // $NON-NLS-1$ } else if (saveConfig.saveFieldNames()) { writer.println(CSVSaveService.printableFieldNamesToString(saveConfig)); } }
private static void writeFileStart(PrintWriter writer, SampleSaveConfiguration saveConfig) { if (saveConfig.saveAsXml()) { writer.print(XML_HEADER); // Write the EOL separately so we generate LF line ends on Unix and // Windows writer.print("\n"); String pi = saveConfig.getXmlPi(); if (pi.length() > 0) { writer.println(pi); } writer.print(TESTRESULTS_START_V1_1_PREVER); writer.print(SaveService.getVERSION()); writer.print(TESTRESULTS_START_V1_1_POSTVER); // Write the EOL separately so we generate LF line ends on Unix and // Windows writer.print("\n"); } else if (saveConfig.saveFieldNames()) { writer.println(CSVSaveService .printableFieldNamesToString(saveConfig)); } }
private static void writeFileStart(PrintWriter writer, SampleSaveConfiguration saveConfig) { if (saveConfig.saveAsXml()) { writer.print(XML_HEADER); // Write the EOL separately so we generate LF line ends on Unix and // Windows writer.print("\n"); String pi = saveConfig.getXmlPi(); if (pi.length() > 0) { writer.println(pi); } writer.print(TESTRESULTS_START_V1_1_PREVER); writer.print(SaveService.getVERSION()); writer.print(TESTRESULTS_START_V1_1_POSTVER); // Write the EOL separately so we generate LF line ends on Unix and // Windows writer.print("\n"); } else if (saveConfig.saveFieldNames()) { writer.println(CSVSaveService .printableFieldNamesToString(saveConfig)); } }
if (saveConfig.saveAsXml()) { trimmed = trimLastLine(filename); } else {
log.info("--save-as-xml " + saveConfig.saveAsXml()); } else { throw new UnsupportedOperationException("Unrecognized option: "
log.info("--save-as-xml " + saveConfig.saveAsXml()); } else { throw new UnsupportedOperationException("Unrecognized option: "
log.info("--save-as-xml " + saveConfig.saveAsXml()); } else { throw new UnsupportedOperationException("Unrecognized option: "
@Override public void testStarted(String host) { if (!isWorkingHost(host)) { return; } //ensure the data will be saved if (getProperty(FILENAME) == null || getProperty(FILENAME).getStringValue().trim().length() == 0) { if (autoGenerateFiles) { setupSaving(getAutoFileName()); } else { try { File tmpFile = File.createTempFile("perfmon_", ".jtl"); tmpFile.delete(); // required to have CSV header setupSaving(tmpFile.getAbsolutePath()); } catch (IOException ex) { log.info("PerfMon metrics will not be recorded! Please run the test with -JforcePerfmonFile=true", ex); } } } log.debug("PerfMon metrics will be stored in " + getPropertyAsString(FILENAME)); if (!getSaveConfig().saveAsXml() && getSaveConfig().saveFieldNames()) { filesList.add(getPropertyAsString(FILENAME)); } else { log.warn("Perfmon file saving setting is not CSV with header line, cannot upload it to BM.Sense: " + getPropertyAsString(FILENAME)); } initiateConnectors(); workerThread = new Thread(this); workerThread.start(); super.testStarted(host); }
@Override public void testStarted(String host) { if (!isWorkingHost(host)) { return; } //ensure the data will be saved if (getProperty(FILENAME) == null || getProperty(FILENAME).getStringValue().trim().length() == 0) { if (autoGenerateFiles) { setupSaving(getAutoFileName()); } else { try { File tmpFile = File.createTempFile("perfmon_", ".jtl"); tmpFile.delete(); // required to have CSV header setupSaving(tmpFile.getAbsolutePath()); } catch (IOException ex) { log.info("PerfMon metrics will not be recorded! Please run the test with -JforcePerfmonFile=true", ex); } } } log.debug("PerfMon metrics will be stored in " + getPropertyAsString(FILENAME)); if (!getSaveConfig().saveAsXml() && getSaveConfig().saveFieldNames()) { filesList.add(getPropertyAsString(FILENAME)); } else { log.warn("Perfmon file saving setting is not CSV with header line: " + getPropertyAsString(FILENAME)); } initiateConnectors(); workerThread = new Thread(this); workerThread.start(); super.testStarted(host); }
@Override public void testStarted(String host) { if (!isWorkingHost(host)) { return; } //ensure the data will be saved if (getProperty(FILENAME) == null || getProperty(FILENAME).getStringValue().trim().length() == 0) { if (autoGenerateFiles) { setupSaving(getAutoFileName()); } else { try { File tmpFile = File.createTempFile("perfmon_", ".jtl"); tmpFile.delete(); // required to have CSV header setupSaving(tmpFile.getAbsolutePath()); } catch (IOException ex) { log.info("PerfMon metrics will not be recorded! Please run the test with -JforcePerfmonFile=true", ex); } } } log.debug("PerfMon metrics will be stored in " + getPropertyAsString(FILENAME)); if (!getSaveConfig().saveAsXml() && getSaveConfig().saveFieldNames()) { filesList.add(getPropertyAsString(FILENAME)); } else { log.warn("Perfmon file saving setting is not CSV with header line, cannot upload it to BM.Sense: " + getPropertyAsString(FILENAME)); } initiateConnectors(); workerThread = new Thread(this); workerThread.start(); super.testStarted(host); }
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); } }