use of uk.co.automatictester.lightning.utils.IntToOrdConverter in project lightning by automatictester.
the class RespTimeNthPercentileTest method execute.
@Override
public void execute(ArrayList<String[]> originalJMeterTransactions) {
try {
JMeterTransactions transactions = filterTransactions((JMeterTransactions) originalJMeterTransactions);
transactionCount = transactions.getTransactionCount();
DescriptiveStatistics ds = new DescriptiveStatistics();
ds.setPercentileImpl(new Percentile().withEstimationType(Percentile.EstimationType.R_3));
for (String[] transaction : transactions) {
String elapsed = transaction[1];
ds.addValue(Double.parseDouble(elapsed));
}
longestTransactions = transactions.getLongestTransactions();
actualResult = (int) ds.getPercentile((double) percentile);
actualResultDescription = String.format(ACTUAL_RESULT_MESSAGE, new IntToOrdConverter().convert(percentile), actualResult);
if (actualResult > maxRespTime) {
result = TestResult.FAIL;
} else {
result = TestResult.PASS;
}
} catch (Exception e) {
result = TestResult.ERROR;
actualResultDescription = e.getMessage();
}
}
Aggregations