statisticsWriter.append("#queryRate \tnode \tstartTime \tendTime \telapseTime \tquery \n");
resultWriter
.append("#requestedQueryRate \tachievedQueryRate \tfiredQueries \tqueryErrors \tavarageQueryDuration \tstandardDeviation \n");
}
try {
StorelessUnivariateStatistic timeStandardDeviation = new StandardDeviation();
StorelessUnivariateStatistic timeMean = new Mean();
int errors = 0;
for (LoadTestQueryResult result : queryResults) {
long elapsedTime = result.getEndTime() > 0 ? result.getEndTime() - result.getStartTime() : -1;
statisticsWriter.write(queryRate + "\t" + result.getNodeId() + "\t" + result.getStartTime() + "\t"
+ result.getEndTime() + "\t" + elapsedTime + "\t" + result.getQuery() + "\n");
if (elapsedTime != -1) {
timeStandardDeviation.increment(elapsedTime);
timeMean.increment(elapsedTime);
} else {
++errors;
}
}
resultWriter.write(queryRate + "\t" + ((double) queryResults.size() / (_runTime / 1000)) + "\t"
+ queryResults.size() + "\t" + errors + "\t" + (int) timeMean.getResult() + "\t"
+ (int) timeStandardDeviation.getResult() + "\n");
} catch (IOException e) {
throw new IllegalStateException("Failed to write statistics data.", e);
}
try {