Skip to content

Commit

Permalink
Merge pull request wolfpld#509 from topolarity/count-before-after
Browse files Browse the repository at this point in the history
Add left/right counts to histogram tooltip
  • Loading branch information
wolfpld committed Jan 7, 2023
2 parents f90336a + cabfe25 commit 2c1b0c6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/TracyView_FindZone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1249,22 +1249,28 @@ void View::DrawFindZone()
}

int64_t tBefore = 0;
int64_t cntBefore = 0;
for( int i=0; i<bin; i++ )
{
tBefore += binTime[i];
cntBefore += bins[i];
}

int64_t tAfter = 0;
int64_t cntAfter = 0;
for( int i=bin+1; i<numBins; i++ )
{
tAfter += binTime[i];
cntAfter += bins[i];
}

ImGui::BeginTooltip();
TextDisabledUnformatted( "Time range:" );
ImGui::SameLine();
ImGui::Text( "%s - %s", TimeToString( t0 ), TimeToString( t1 ) );
TextFocused( "Count:", RealToString( bins[bin] ) );
TextFocused( "Count in the left bins:", RealToString( cntBefore ) );
TextFocused( "Count in the right bins:", RealToString( cntAfter ) );
TextFocused( "Time spent in bin:", TimeToString( binTime[bin] ) );
TextFocused( "Time spent in the left bins:", TimeToString( tBefore ) );
TextFocused( "Time spent in the right bins:", TimeToString( tAfter ) );
Expand Down

0 comments on commit 2c1b0c6

Please sign in to comment.