From cc0f158c16b6ae7ebd31142142391a6e30299bb0 Mon Sep 17 00:00:00 2001 From: wernhervondata Date: Wed, 30 Oct 2024 22:44:52 +0100 Subject: [PATCH] percentiles p75, p90 for FindZone view --- profiler/src/profiler/TracyView.hpp | 3 +++ profiler/src/profiler/TracyView_FindZone.cpp | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/profiler/src/profiler/TracyView.hpp b/profiler/src/profiler/TracyView.hpp index 19e97662..d59c03d6 100644 --- a/profiler/src/profiler/TracyView.hpp +++ b/profiler/src/profiler/TracyView.hpp @@ -667,6 +667,7 @@ private: size_t sortedNum = 0, selSortNum, selSortActive; float average, selAverage; float median, selMedian; + float p75, p90; int64_t total, selTotal; int64_t selTime; bool drawAvgMed = true; @@ -710,6 +711,8 @@ private: sortedNum = 0; average = 0; median = 0; + p75 = 0; + p90 = 0; total = 0; tmin = std::numeric_limits::max(); tmax = std::numeric_limits::min(); diff --git a/profiler/src/profiler/TracyView_FindZone.cpp b/profiler/src/profiler/TracyView_FindZone.cpp index b77d513a..8ced9ea1 100644 --- a/profiler/src/profiler/TracyView_FindZone.cpp +++ b/profiler/src/profiler/TracyView_FindZone.cpp @@ -549,10 +549,13 @@ void View::DrawFindZone() std::inplace_merge( vec.begin(), mid, vec.end() ); const auto vsz = vec.size(); + const auto vszQuarter = vsz / 4; if( vsz != 0 ) { m_findZone.average = float( total ) / vsz; m_findZone.median = vec[vsz/2]; + m_findZone.p75 = vec[3 * vszQuarter]; + m_findZone.p90 = vec[vsz / 10 * 9]; m_findZone.total = total; m_findZone.sortedNum = i; m_findZone.tmin = tmin; @@ -972,6 +975,12 @@ void View::DrawFindZone() TextFocused( "Median:", TimeToString( m_findZone.median ) ); ImGui::SameLine(); ImGui::Spacing(); + TextFocused( "P75:", TimeToString( m_findZone.p75 ) ); + ImGui::SameLine(); + ImGui::Spacing(); + TextFocused( "P90:", TimeToString( m_findZone.p90 ) ); + ImGui::SameLine(); + ImGui::Spacing(); ImGui::SameLine(); { int64_t t0, t1;