Count transferred data size.

This commit is contained in:
Bartosz Taudul 2019-10-24 00:47:16 +02:00
parent 2d31ca993e
commit 1cfb5adc44
2 changed files with 4 additions and 1 deletions

View File

@ -2435,6 +2435,7 @@ void Worker::Exec()
m_mbpsData.mbps.emplace_back( bytes / ( td * 125.f ) ); m_mbpsData.mbps.emplace_back( bytes / ( td * 125.f ) );
m_mbpsData.compRatio = float( bytes ) / decBytes; m_mbpsData.compRatio = float( bytes ) / decBytes;
m_mbpsData.queue = m_serverQueryQueue.size(); m_mbpsData.queue = m_serverQueryQueue.size();
m_mbpsData.transferred += bytes;
t0 = t1; t0 = t1;
bytes = 0; bytes = 0;
decBytes = 0; decBytes = 0;

View File

@ -221,12 +221,13 @@ private:
struct MbpsBlock struct MbpsBlock
{ {
MbpsBlock() : mbps( 64 ), compRatio( 1.0 ), queue( 0 ) {} MbpsBlock() : mbps( 64 ), compRatio( 1.0 ), queue( 0 ), transferred( 0 ) {}
std::shared_mutex lock; std::shared_mutex lock;
std::vector<float> mbps; std::vector<float> mbps;
float compRatio; float compRatio;
size_t queue; size_t queue;
uint64_t transferred;
}; };
enum class NextCallstackType enum class NextCallstackType
@ -375,6 +376,7 @@ public:
const std::vector<float>& GetMbpsData() const { return m_mbpsData.mbps; } const std::vector<float>& GetMbpsData() const { return m_mbpsData.mbps; }
float GetCompRatio() const { return m_mbpsData.compRatio; } float GetCompRatio() const { return m_mbpsData.compRatio; }
size_t GetSendQueueSize() const { return m_mbpsData.queue; } size_t GetSendQueueSize() const { return m_mbpsData.queue; }
uint64_t GetDataTransferred() const { return m_mbpsData.transferred; }
bool HasData() const { return m_hasData.load( std::memory_order_acquire ); } bool HasData() const { return m_hasData.load( std::memory_order_acquire ); }
bool IsConnected() const { return m_connected.load( std::memory_order_relaxed ); } bool IsConnected() const { return m_connected.load( std::memory_order_relaxed ); }