Skip to content

Commit

Permalink
Add mean_io timing in disk search cmd output (#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
suri-kumkaran authored Dec 11, 2024
1 parent 1513ffd commit fc3c6e2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions apps/search_disk_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::vector<uint32_t>> query_result_ids(Lvec.size());
Expand Down Expand Up @@ -270,6 +270,9 @@ int search_disk_index(diskann::Metric &metric, const std::string &index_path_pre
auto mean_cpuus = diskann::get_mean_stats<float>(stats, query_num,
[](const diskann::QueryStats &stats) { return stats.cpu_us; });

auto mean_io_us = diskann::get_mean_stats<float>(stats, query_num,
[](const diskann::QueryStats &stats) { return stats.io_us; });

double recall = 0;
if (calc_recall_flag)
{
Expand All @@ -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;
Expand Down

0 comments on commit fc3c6e2

Please sign in to comment.