diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 4b66e1fc..1d2c2afa 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -167,6 +167,7 @@ View::View( const char* addr ) , m_gpuEnd( 0 ) , m_showOptions( false ) , m_showMessages( false ) + , m_showStatistics( false ) , m_drawGpuZones( true ) , m_drawZones( true ) , m_drawLocks( true ) @@ -294,7 +295,9 @@ void View::DrawImpl() ImGui::SameLine(); if( ImGui::Button( "Messages", ImVec2( 70, 0 ) ) ) m_showMessages = true; ImGui::SameLine(); - if ( ImGui::Button( "Find Zone", ImVec2( 70, 0 ) ) ) m_findZone.show = true; + if( ImGui::Button( "Find Zone", ImVec2( 70, 0 ) ) ) m_findZone.show = true; + ImGui::SameLine(); + if( ImGui::Button( "Statistics", ImVec2( 70, 0 ) ) ) m_showStatistics = true; ImGui::SameLine(); ImGui::Text( "Frames: %-7" PRIu64 " Time span: %-10s View span: %-10s Zones: %-13s Queue delay: %s Timer resolution: %s", m_worker.GetFrameCount(), TimeToString( m_worker.GetLastTime() - m_worker.GetFrameBegin( 0 ) ), TimeToString( m_zvEnd - m_zvStart ), RealToString( m_worker.GetZoneCount(), true ), TimeToString( m_worker.GetDelay() ), TimeToString( m_worker.GetResolution() ) ); DrawFrames(); @@ -309,6 +312,7 @@ void View::DrawImpl() if( m_showOptions ) DrawOptions(); if( m_showMessages ) DrawMessages(); if( m_findZone.show ) DrawFindZone(); + if( m_showStatistics ) DrawStatistics(); if( m_zoomAnim.active ) { @@ -3447,6 +3451,18 @@ void View::DrawFindZone() ImGui::End(); } +void View::DrawStatistics() +{ + ImGui::Begin( "Statistics", &m_showStatistics ); +#ifdef TRACY_NO_STATISTICS + ImGui::TextWrapped( "Collection of statistical data is disabled in this build." ); + ImGui::TextWrapped( "Rebuild without the TRACY_NO_STATISTICS macro to enable statistics view." ); +#else + +#endif + ImGui::End(); +} + uint32_t View::GetZoneColor( const ZoneEvent& ev ) { const auto& srcloc = m_worker.GetSourceLocation( ev.srcloc ); diff --git a/server/TracyView.hpp b/server/TracyView.hpp index f9aaefdb..bbd8ee3a 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -73,6 +73,7 @@ private: void DrawOptions(); void DrawMessages(); void DrawFindZone(); + void DrawStatistics(); void DrawInfoWindow(); void DrawZoneInfoWindow(); @@ -157,6 +158,7 @@ private: bool m_showOptions; bool m_showMessages; + bool m_showStatistics; bool m_drawGpuZones; bool m_drawZones; bool m_drawLocks;