From f24fdf2fd310a5f868e15cd9682ca37d740c77af Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Tue, 30 Jan 2024 15:31:03 -0500 Subject: Benchmarking updates --- include/framework/scheduling/statistics.h | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/framework/scheduling/statistics.h b/include/framework/scheduling/statistics.h index 8466ffc..50ba196 100644 --- a/include/framework/scheduling/statistics.h +++ b/include/framework/scheduling/statistics.h @@ -67,19 +67,33 @@ public: if (type == 1) { m_type_1_cnt.fetch_add(1); m_type_1_total_time.fetch_add(length); + + if (length > m_type_1_largest_time) { + m_type_1_largest_time.store(length); + } } else { m_type_2_cnt.fetch_add(1); m_type_2_total_time.fetch_add(length); + + if (length > m_type_2_largest_time) { + m_type_2_largest_time.store(length); + } } } void print_statistics() { - fprintf(stdout, "Query Count: %ld\tQuery Avg. Latency: %ld\n", - m_type_1_cnt.load(), - m_type_1_total_time.load() / m_type_1_cnt.load()); - fprintf(stdout, "Reconstruction Count: %ld\tReconstruction Avg. Latency: %ld\n", - m_type_2_cnt.load(), - m_type_2_total_time.load() / m_type_2_cnt.load()); + if (m_type_1_cnt > 0) { + fprintf(stdout, "Query Count: %ld\tQuery Avg. Latency: %ld\tMax Query Latency: %ld\n", + m_type_1_cnt.load(), + m_type_1_total_time.load() / m_type_1_cnt.load(), + m_type_1_largest_time.load()); + } + if (m_type_2_cnt > 0) { + fprintf(stdout, "Reconstruction Count: %ld\tReconstruction Avg. Latency: %ld\tMax Recon. Latency:%ld\n", + m_type_2_cnt.load(), + m_type_2_total_time.load() / m_type_2_cnt.load(), + m_type_2_largest_time.load()); + } } private: @@ -92,5 +106,8 @@ private: std::atomic m_type_2_cnt; std::atomic m_type_2_total_time; + + std::atomic m_type_1_largest_time; + std::atomic m_type_2_largest_time; }; } -- cgit v1.2.3