From fc3c6e25b4229016d1b40d2510c327d832b6c25b Mon Sep 17 00:00:00 2001 From: Suryansh Gupta Date: Wed, 11 Dec 2024 19:01:05 +0530 Subject: [PATCH] Add mean_io timing in disk search cmd output (#607) --- apps/search_disk_index.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/search_disk_index.cpp b/apps/search_disk_index.cpp index 7e2a7ac6d..6b0793db7 100644 --- a/apps/search_disk_index.cpp +++ b/apps/search_disk_index.cpp @@ -179,15 +179,15 @@ int search_disk_index(diskann::Metric &metric, const std::string &index_path_pre std::string recall_string = "Recall@" + std::to_string(recall_at); diskann::cout << std::setw(6) << "L" << std::setw(12) << "Beamwidth" << std::setw(16) << "QPS" << std::setw(16) << "Mean Latency" << std::setw(16) << "99.9 Latency" << std::setw(16) << "Mean IOs" << std::setw(16) - << "CPU (s)"; + << "Mean IO (us)" << std::setw(16) << "CPU (s)"; if (calc_recall_flag) { diskann::cout << std::setw(16) << recall_string << std::endl; } else diskann::cout << std::endl; - diskann::cout << "===============================================================" - "=======================================================" + diskann::cout << "==================================================================" + "=================================================================" << std::endl; std::vector> query_result_ids(Lvec.size()); @@ -270,6 +270,9 @@ int search_disk_index(diskann::Metric &metric, const std::string &index_path_pre auto mean_cpuus = diskann::get_mean_stats(stats, query_num, [](const diskann::QueryStats &stats) { return stats.cpu_us; }); + auto mean_io_us = diskann::get_mean_stats(stats, query_num, + [](const diskann::QueryStats &stats) { return stats.io_us; }); + double recall = 0; if (calc_recall_flag) { @@ -280,7 +283,7 @@ int search_disk_index(diskann::Metric &metric, const std::string &index_path_pre diskann::cout << std::setw(6) << L << std::setw(12) << optimized_beamwidth << std::setw(16) << qps << std::setw(16) << mean_latency << std::setw(16) << latency_999 << std::setw(16) << mean_ios - << std::setw(16) << mean_cpuus; + << std::setw(16) << mean_io_us << std::setw(16) << mean_cpuus; if (calc_recall_flag) { diskann::cout << std::setw(16) << recall << std::endl;