final long start = System.currentTimeMillis();
long s = start;
long responseTime = 0;
int count = 0;
long resultCount = 0;
Iface client = BlurClient.getClient(connectionStr);
int i;
for (i = 0; i < numberOfSearchesPerPass; i++) {
long now = System.currentTimeMillis();
if (s + timeBetweenReporting < now) {
double avgSeconds = (now - start) / 1000.0;
double seconds = (now - s) / 1000.0;
double avgRate = i / avgSeconds;
double rate = count / seconds;
double responseTimeAvg = (responseTime / (double) count) / 1000000.0;
System.out.println(System.currentTimeMillis() + "," + i + "," + responseTimeAvg + "," + rate + "," + avgRate + "," + resultCount + "," + getCount(client, tableName));
s = now;
responseTime = 0;
count = 0;
resultCount = 0;
}
builder.setLength(0);
String query = generateQuery(builder, random, sampleOfTerms, numberOfTermsPerQuery);
final BlurQuery blurQuery = new BlurQuery();
blurQuery.query = new Query();
blurQuery.query.query = query;
blurQuery.cacheResult = false;
blurQuery.selector = new Selector();
long qs = System.nanoTime();
BlurResults results = client.query(tableName, blurQuery);
long qe = System.nanoTime();
resultCount += results.totalResults;
responseTime += (qe - qs);
count++;
}