Merge pull request #926 from WernherVonData/percentiles-for-find-zone

Percentiles p75, p90 for FindZone view
This commit is contained in:
Bartosz Taudul 2024-11-17 12:18:27 +01:00 committed by GitHub
commit e6ee311392
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

View File

@ -667,6 +667,7 @@ private:
size_t sortedNum = 0, selSortNum, selSortActive; size_t sortedNum = 0, selSortNum, selSortActive;
float average, selAverage; float average, selAverage;
float median, selMedian; float median, selMedian;
float p75, p90;
int64_t total, selTotal; int64_t total, selTotal;
int64_t selTime; int64_t selTime;
bool drawAvgMed = true; bool drawAvgMed = true;
@ -710,6 +711,8 @@ private:
sortedNum = 0; sortedNum = 0;
average = 0; average = 0;
median = 0; median = 0;
p75 = 0;
p90 = 0;
total = 0; total = 0;
tmin = std::numeric_limits<int64_t>::max(); tmin = std::numeric_limits<int64_t>::max();
tmax = std::numeric_limits<int64_t>::min(); tmax = std::numeric_limits<int64_t>::min();

View File

@ -553,6 +553,8 @@ void View::DrawFindZone()
{ {
m_findZone.average = float( total ) / vsz; m_findZone.average = float( total ) / vsz;
m_findZone.median = vec[vsz/2]; m_findZone.median = vec[vsz/2];
m_findZone.p75 = vec[3 * (vsz / 4)];
m_findZone.p90 = vec[vsz / 10 * 9];
m_findZone.total = total; m_findZone.total = total;
m_findZone.sortedNum = i; m_findZone.sortedNum = i;
m_findZone.tmin = tmin; m_findZone.tmin = tmin;
@ -972,6 +974,12 @@ void View::DrawFindZone()
TextFocused( "Median:", TimeToString( m_findZone.median ) ); TextFocused( "Median:", TimeToString( m_findZone.median ) );
ImGui::SameLine(); ImGui::SameLine();
ImGui::Spacing(); ImGui::Spacing();
TextFocused( "P75:", TimeToString( m_findZone.p75 ) );
ImGui::SameLine();
ImGui::Spacing();
TextFocused( "P90:", TimeToString( m_findZone.p90 ) );
ImGui::SameLine();
ImGui::Spacing();
ImGui::SameLine(); ImGui::SameLine();
{ {
int64_t t0, t1; int64_t t0, t1;