mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-29 01:16:20 -05:00
made avgReadCount and avgSendCound to be uint32_t instead of floats, since they count bytes. Changes kb to 1024 instead of 1000
This commit is contained in:
parent
eb9025d9a4
commit
8e75185060
@ -227,8 +227,8 @@ void pqistreamer::updateRates()
|
|||||||
|
|
||||||
if (diff > PQISTREAM_AVG_PERIOD)
|
if (diff > PQISTREAM_AVG_PERIOD)
|
||||||
{
|
{
|
||||||
float avgReadpSec = getRate(true ) * PQISTREAM_AVG_FRAC + (1.0 - PQISTREAM_AVG_FRAC) * mAvgReadCount/(1000.0 * float(diff));
|
float avgReadpSec = getRate(true ) * PQISTREAM_AVG_FRAC + (1.0 - PQISTREAM_AVG_FRAC) * mAvgReadCount/(1024.0 * float(diff));
|
||||||
float avgSentpSec = getRate(false) * PQISTREAM_AVG_FRAC + (1.0 - PQISTREAM_AVG_FRAC) * mAvgSentCount/(1000.0 * float(diff));
|
float avgSentpSec = getRate(false) * PQISTREAM_AVG_FRAC + (1.0 - PQISTREAM_AVG_FRAC) * mAvgSentCount/(1024.0 * float(diff));
|
||||||
|
|
||||||
#ifdef DEBUG_PQISTREAMER
|
#ifdef DEBUG_PQISTREAMER
|
||||||
std::cerr << "Peer " << PeerId() << ": Current speed estimates: " << avgReadpSec << " / " << avgSentpSec << std::endl;
|
std::cerr << "Peer " << PeerId() << ": Current speed estimates: " << avgReadpSec << " / " << avgSentpSec << std::endl;
|
||||||
|
@ -154,8 +154,8 @@ class pqistreamer: public PQInterface
|
|||||||
time_t mCurrSentTS;
|
time_t mCurrSentTS;
|
||||||
|
|
||||||
time_t mAvgLastUpdate; // TS from which these are measured.
|
time_t mAvgLastUpdate; // TS from which these are measured.
|
||||||
float mAvgReadCount;
|
uint32_t mAvgReadCount;
|
||||||
float mAvgSentCount;
|
uint32_t mAvgSentCount;
|
||||||
|
|
||||||
time_t mLastIncomingTs;
|
time_t mLastIncomingTs;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user