use of uk.co.automatictester.lightning.exceptions.CSVFileIOException in project lightning by automatictester.
the class JMeterCSVFileReader method getTransactions.
public JMeterTransactions getTransactions(File csvFile) {
long start = System.currentTimeMillis();
logger.debug("Reading CSV file - start");
JMeterTransactions jmeterTransactions = new JMeterTransactions();
try (FileReader fr = new FileReader(csvFile)) {
jmeterTransactions.addAll(getParser().parseAll(fr));
} catch (IOException e) {
throw new CSVFileIOException(e);
}
if (jmeterTransactions.isEmpty()) {
throw new CSVFileNoTransactionsException();
}
long finish = System.currentTimeMillis();
long millisecondsBetween = finish - start;
logger.debug("Reading CSV file - finish, read {} rows, took {}ms", jmeterTransactions.size(), millisecondsBetween);
return jmeterTransactions;
}
use of uk.co.automatictester.lightning.exceptions.CSVFileIOException in project lightning by automatictester.
the class PerfMonS3ObjectDataReader method getDataEntires.
public PerfMonDataEntries getDataEntires(String csvObject) {
PerfMonDataEntries perfMonDataEntries = new PerfMonDataEntries();
String csvObjectContent = s3Client.getS3ObjectContent(csvObject);
try (InputStreamReader isr = new InputStreamReader(new ByteArrayInputStream(csvObjectContent.getBytes()))) {
perfMonDataEntries.addAll(getParser().parseAll(isr));
} catch (IOException e) {
throw new CSVFileIOException(e);
}
if (perfMonDataEntries.isEmpty()) {
throw new CSVFileNoTransactionsException();
}
return perfMonDataEntries;
}
use of uk.co.automatictester.lightning.exceptions.CSVFileIOException in project lightning by automatictester.
the class JMeterCSVS3ObjectReader method getTransactions.
public JMeterTransactions getTransactions(String csvObject) {
long start = System.currentTimeMillis();
log.debug("Reading CSV file - start");
JMeterTransactions jmeterTransactions = new JMeterTransactions();
String csvObjectContent = s3Client.getS3ObjectContent(csvObject);
try (InputStreamReader isr = new InputStreamReader(new ByteArrayInputStream(csvObjectContent.getBytes()))) {
jmeterTransactions.addAll(getParser().parseAll(isr));
} catch (IOException e) {
throw new CSVFileIOException(e);
}
if (jmeterTransactions.isEmpty()) {
throw new CSVFileNoTransactionsException();
}
long finish = System.currentTimeMillis();
long millisecondsBetween = finish - start;
log.debug("Reading CSV file - finish, read {} rows, took {}ms", jmeterTransactions.size(), millisecondsBetween);
return jmeterTransactions;
}
Aggregations