SampleStatistics localProcessingStatistics = getLocalProcessingStatistics(allConnectionStatistics);
// Get statistics for sending data.
SampleStatistics sendDataStatistics = getSendDataStatistics(allConnectionStatistics);
// Get statistics for remote processing.
for (int i = 0; i < allConnectionStatistics.size(); ++i) {
BulkInsertConnectionStatistics connectionStatistics = allConnectionStatistics.get(i);
values[i] = connectionStatistics.getRemoteProcessingTimeMillis();
}
SampleStatistics remoteProcessingStatistics = SampleStatistics.statisticsForPopulation(values);
// Get statistics for receiving data.
for (int i = 0; i < allConnectionStatistics.size(); ++i) {
BulkInsertConnectionStatistics connectionStatistics = allConnectionStatistics.get(i);
values[i] = connectionStatistics.getReceivedDataTimeMillis();
}
SampleStatistics receiveDataStatistics = SampleStatistics.statisticsForPopulation(values);
// Calculate the rate of documents inserted per second.
long numBulkInsertedDocs = (parsedArguments.numDocumentsPerBulkInsert *
parsedArguments.numBulkInsertOperations);
double remoteProcessingRate = 0;
double localInsertRate = 0;
for (BulkInsertConnectionStatistics connectionStatistics : allConnectionStatistics) {
remoteProcessingRate += (MILLIS_PER_SEC * numBulkInsertedDocs /
connectionStatistics.getRemoteProcessingTimeMillis());
long nonLocalProcessingTime = connectionStatistics.getSendDataTimeMillis() +
connectionStatistics.getRemoteProcessingTimeMillis() +
connectionStatistics.getReceivedDataTimeMillis();
localInsertRate += (MILLIS_PER_SEC * numBulkInsertedDocs / nonLocalProcessingTime);
}
return new BulkInsertBenchmarkResults(timeTaken,
totalJsonBytesSent,