hsbench: output max throughput result

This commit is contained in:
Matthew Barr 2017-04-11 14:27:59 +10:00
parent 9acda484fe
commit 85358e0ad0

View File

@ -597,6 +597,17 @@ void displayPerScanResults(const vector<unique_ptr<ThreadContext>> &threads,
printf("\n");
}
static
double fastestResult(const vector<unique_ptr<ThreadContext>> &threads) {
double best = threads[0]->results[0].seconds;
for (const auto &t : threads) {
for (const auto &r : t->results) {
best = min(best, r.seconds);
}
}
return best;
}
static
u64a byte_size(const vector<DataBlock> &corpus_blocks) {
u64a total = 0;
@ -650,8 +661,12 @@ void displayResults(const vector<unique_ptr<ThreadContext>> &threads,
double blockRate = (double)totalBlocks / (double)totalSecs;
printf("Overall block rate: %'0.2f blocks/sec\n", blockRate);
printf("Overall throughput: %'0.2Lf Mbit/sec\n",
printf("Mean throughput: %'0.2Lf Mbit/sec\n",
calc_mbps(totalSecs, totalBytes));
double lowestScanTime = fastestResult(threads);
printf("Maximum throughput: %'0.2Lf Mbit/sec\n",
calc_mbps(lowestScanTime, bytesPerRun));
printf("\n");
if (display_per_scan) {