Display number of in-flight queries.

This commit is contained in:
Bartosz Taudul 2020-03-27 02:00:26 +01:00
parent 089681267f
commit 51bae7855d
3 changed files with 31 additions and 10 deletions

View File

@ -658,6 +658,8 @@ void View::DrawNotificationArea()
{
auto& io = ImGui::GetIO();
const auto ty = ImGui::GetFontSize();
if( m_worker.IsConnected() )
{
const auto sqs = m_worker.GetSendQueueSize();
if( sqs != 0 )
{
@ -670,6 +672,22 @@ void View::DrawNotificationArea()
ImGui::EndTooltip();
}
}
else
{
const auto sif = m_worker.GetSendInFlight();
if( sif != 0 )
{
ImGui::SameLine();
TextColoredUnformatted( ImVec4( 1, 0.75f, 0, 1 ), ICON_FA_TACHOMETER_ALT );
if( ImGui::IsItemHovered() )
{
ImGui::BeginTooltip();
TextFocused( "Queries in flight:", RealToString( sif ) );
ImGui::EndTooltip();
}
}
}
}
auto& crash = m_worker.GetCrashEvent();
if( crash.thread != 0 )
{
@ -872,6 +890,8 @@ bool View::DrawConnection()
ImGui::Text( "%6.2f Mbps", mbps / m_worker.GetCompRatio() );
TextFocused( "Data transferred:", MemSizeToString( m_worker.GetDataTransferred() ) );
TextFocused( "Query backlog:", RealToString( m_worker.GetSendQueueSize() ) );
ImGui::SameLine();
TextFocused( "+", RealToString( m_worker.GetSendInFlight() ) );
}
TextFocused( "Memory usage:", MemSizeToString( memUsage ) );

View File

@ -2717,7 +2717,7 @@ void Worker::Exec()
}
}
m_serverQuerySpaceLeft = ( m_sock.GetSendBufSize() / ServerQueryPacketSize ) - ServerQueryPacketSize; // leave space for terminate request
m_serverQuerySpaceBase = m_serverQuerySpaceLeft = ( m_sock.GetSendBufSize() / ServerQueryPacketSize ) - ServerQueryPacketSize; // leave space for terminate request
m_hasData.store( true, std::memory_order_release );
LZ4_setStreamDecode( (LZ4_streamDecode_t*)m_stream, nullptr, 0 );

View File

@ -495,6 +495,7 @@ public:
const std::vector<float>& GetMbpsData() const { return m_mbpsData.mbps; }
float GetCompRatio() const { return m_mbpsData.compRatio; }
size_t GetSendQueueSize() const { return m_mbpsData.queue; }
size_t GetSendInFlight() const { return m_serverQuerySpaceBase - m_serverQuerySpaceLeft; }
uint64_t GetDataTransferred() const { return m_mbpsData.transferred; }
bool HasData() const { return m_hasData.load( std::memory_order_acquire ); }
@ -804,7 +805,7 @@ private:
PlotData* m_sysTimePlot = nullptr;
Vector<ServerQueryPacket> m_serverQueryQueue;
size_t m_serverQuerySpaceLeft;
size_t m_serverQuerySpaceLeft, m_serverQuerySpaceBase;
unordered_flat_map<uint64_t, int32_t> m_frameImageStaging;
char* m_frameImageBuffer = nullptr;