| 502 | } |
| 503 | |
| 504 | void report(MultiStats & infos) |
| 505 | { |
| 506 | std::lock_guard lock(mutex); |
| 507 | |
| 508 | Stats total_stats{}; |
| 509 | |
| 510 | std::cerr << "\n"; |
| 511 | for (size_t i = 0; i < infos.size(); ++i) |
| 512 | { |
| 513 | const auto & info = infos[i]; |
| 514 | |
| 515 | /// Avoid zeros, nans or exceptions |
| 516 | if (0 == info->queries) |
| 517 | return; |
| 518 | |
| 519 | if (print_detail) |
| 520 | info->print(connections[i]->getDescription(), concurrency); |
| 521 | else |
| 522 | total_stats.add(*info); |
| 523 | } |
| 524 | |
| 525 | if (!print_detail) |
| 526 | total_stats.print("", concurrency); |
| 527 | |
| 528 | std::cerr << "\n"; |
| 529 | |
| 530 | auto print_percentile = [&](double percent) |
| 531 | { |
| 532 | std::cerr << percent << "%\t\t"; |
| 533 | if (print_detail) |
| 534 | { |
| 535 | for (const auto & info : infos) |
| 536 | { |
| 537 | std::cerr << info->sampler.quantileNearest(percent / 100.0) << " sec.\t"; |
| 538 | } |
| 539 | } |
| 540 | else |
| 541 | { |
| 542 | std::cerr << total_stats.sampler.quantileNearest(percent / 100.0) << " sec.\t"; |
| 543 | } |
| 544 | std::cerr << "\n"; |
| 545 | }; |
| 546 | |
| 547 | for (int percent = 0; percent <= 90; percent += 10) |
| 548 | print_percentile(percent); |
| 549 | |
| 550 | print_percentile(95); |
| 551 | print_percentile(99); |
| 552 | print_percentile(99.9); |
| 553 | print_percentile(99.99); |
| 554 | |
| 555 | std::cerr << "\n" << t_test.compareAndReport(confidence).second << "\n"; |
| 556 | |
| 557 | if (!cumulative) |
| 558 | { |
| 559 | for (auto & info : infos) |
| 560 | info->clear(); |
| 561 | } |
nothing calls this directly
no test coverage detected