Throughput data is not related to event data.

This commit is contained in:
Bartosz Taudul 2017-09-15 20:31:59 +02:00
parent 2947fb6563
commit 19f67504b1
2 changed files with 7 additions and 4 deletions

View File

@ -106,7 +106,7 @@ void View::Worker()
enum { MbpsUpdateTime = 200 };
if( td > MbpsUpdateTime )
{
std::lock_guard<std::mutex> lock( m_lock );
std::lock_guard<std::mutex> lock( m_mbpslock );
m_mbps.erase( m_mbps.begin() );
m_mbps.emplace_back( 8.f * MbpsUpdateTime * bytes / ( td * 1000 * 1000 ) );
t0 = t1;
@ -267,10 +267,9 @@ void View::Draw()
void View::DrawImpl()
{
std::lock_guard<std::mutex> lock( m_lock );
// Connection window
{
std::lock_guard<std::mutex> lock( m_mbpslock );
const auto mbps = m_mbps.back();
char buf[64];
if( mbps < 0.1f )
@ -285,6 +284,8 @@ void View::DrawImpl()
ImGui::PlotLines( buf, m_mbps.data(), m_mbps.size(), 0, nullptr, 0 );
ImGui::End();
}
std::lock_guard<std::mutex> lock( m_lock );
}
}

View File

@ -58,10 +58,12 @@ private:
// this block must be locked
std::mutex m_lock;
std::vector<float> m_mbps;
Vector<Event*> m_timeline;
std::unordered_map<uint64_t, std::string> m_strings;
std::mutex m_mbpslock;
std::vector<float> m_mbps;
// not used for vis - no need to lock
std::unordered_map<uint64_t, QueueZoneEnd> m_pendingEndZone;
std::unordered_map<uint64_t, Event*> m_openZones;