mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 20:33:52 +00:00
Update mbps data block after terminating connection.
This commit is contained in:
parent
4634c5cdd3
commit
8fa0a4dc9e
@ -3018,14 +3018,7 @@ void Worker::Exec()
|
|||||||
enum { MbpsUpdateTime = 200 };
|
enum { MbpsUpdateTime = 200 };
|
||||||
if( td > MbpsUpdateTime )
|
if( td > MbpsUpdateTime )
|
||||||
{
|
{
|
||||||
const auto bytes = m_bytes.exchange( 0, std::memory_order_relaxed );
|
UpdateMbps( td );
|
||||||
const auto decBytes = m_decBytes.exchange( 0, std::memory_order_relaxed );
|
|
||||||
std::lock_guard<std::shared_mutex> lock( m_mbpsData.lock );
|
|
||||||
m_mbpsData.mbps.erase( m_mbpsData.mbps.begin() );
|
|
||||||
m_mbpsData.mbps.emplace_back( bytes / ( td * 125.f ) );
|
|
||||||
m_mbpsData.compRatio = float( bytes ) / decBytes;
|
|
||||||
m_mbpsData.queue = m_serverQueryQueue.size();
|
|
||||||
m_mbpsData.transferred += bytes;
|
|
||||||
t0 = t1;
|
t0 = t1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3053,6 +3046,7 @@ void Worker::Exec()
|
|||||||
if( !done ) continue;
|
if( !done ) continue;
|
||||||
}
|
}
|
||||||
QueryTerminate();
|
QueryTerminate();
|
||||||
|
UpdateMbps( 0 );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3064,6 +3058,21 @@ close:
|
|||||||
m_connected.store( false, std::memory_order_relaxed );
|
m_connected.store( false, std::memory_order_relaxed );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Worker::UpdateMbps( int64_t td )
|
||||||
|
{
|
||||||
|
const auto bytes = m_bytes.exchange( 0, std::memory_order_relaxed );
|
||||||
|
const auto decBytes = m_decBytes.exchange( 0, std::memory_order_relaxed );
|
||||||
|
std::lock_guard<std::shared_mutex> lock( m_mbpsData.lock );
|
||||||
|
if( td != 0 )
|
||||||
|
{
|
||||||
|
m_mbpsData.mbps.erase( m_mbpsData.mbps.begin() );
|
||||||
|
m_mbpsData.mbps.emplace_back( bytes / ( td * 125.f ) );
|
||||||
|
}
|
||||||
|
m_mbpsData.compRatio = float( bytes ) / decBytes;
|
||||||
|
m_mbpsData.queue = m_serverQueryQueue.size();
|
||||||
|
m_mbpsData.transferred += bytes;
|
||||||
|
}
|
||||||
|
|
||||||
bool Worker::IsThreadStringRetrieved( uint64_t id )
|
bool Worker::IsThreadStringRetrieved( uint64_t id )
|
||||||
{
|
{
|
||||||
const auto name = GetThreadName( m_failureData.thread );
|
const auto name = GetThreadName( m_failureData.thread );
|
||||||
|
@ -735,6 +735,8 @@ private:
|
|||||||
tracy_force_inline ZoneExtra& AllocZoneExtra( ZoneEvent& ev );
|
tracy_force_inline ZoneExtra& AllocZoneExtra( ZoneEvent& ev );
|
||||||
tracy_force_inline ZoneExtra& RequestZoneExtra( ZoneEvent& ev );
|
tracy_force_inline ZoneExtra& RequestZoneExtra( ZoneEvent& ev );
|
||||||
|
|
||||||
|
void UpdateMbps( int64_t td );
|
||||||
|
|
||||||
int64_t ReadTimeline( FileRead& f, Vector<short_ptr<ZoneEvent>>& vec, uint32_t size, int64_t refTime, int32_t& childIdx );
|
int64_t ReadTimeline( FileRead& f, Vector<short_ptr<ZoneEvent>>& vec, uint32_t size, int64_t refTime, int32_t& childIdx );
|
||||||
void ReadTimelinePre063( FileRead& f, Vector<short_ptr<ZoneEvent>>& vec, uint64_t size, int64_t& refTime, int32_t& childIdx, int fileVer );
|
void ReadTimelinePre063( FileRead& f, Vector<short_ptr<ZoneEvent>>& vec, uint64_t size, int64_t& refTime, int32_t& childIdx, int fileVer );
|
||||||
void ReadTimeline( FileRead& f, Vector<short_ptr<GpuEvent>>& vec, uint64_t size, int64_t& refTime, int64_t& refGpuTime, int32_t& childIdx );
|
void ReadTimeline( FileRead& f, Vector<short_ptr<GpuEvent>>& vec, uint64_t size, int64_t& refTime, int64_t& refGpuTime, int32_t& childIdx );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user