|
|
|
@ -79,7 +79,7 @@ void TrafficGraphWidget::paintEvent(QPaintEvent *)
|
|
|
|
|
int base = floor(log10(fMax));
|
|
|
|
|
float val = pow(10.0f, base);
|
|
|
|
|
|
|
|
|
|
const QString units = tr("KB/s");
|
|
|
|
|
const QString units = tr("kB/s");
|
|
|
|
|
const float yMarginText = 2.0;
|
|
|
|
|
|
|
|
|
|
// draw lines
|
|
|
|
@ -128,10 +128,10 @@ void TrafficGraphWidget::updateRates()
|
|
|
|
|
|
|
|
|
|
quint64 bytesIn = clientModel->node().getTotalBytesRecv(),
|
|
|
|
|
bytesOut = clientModel->node().getTotalBytesSent();
|
|
|
|
|
float inRate = (bytesIn - nLastBytesIn) / 1024.0f * 1000 / timer->interval();
|
|
|
|
|
float outRate = (bytesOut - nLastBytesOut) / 1024.0f * 1000 / timer->interval();
|
|
|
|
|
vSamplesIn.push_front(inRate);
|
|
|
|
|
vSamplesOut.push_front(outRate);
|
|
|
|
|
float in_rate_kilobytes_per_sec = static_cast<float>(bytesIn - nLastBytesIn) / timer->interval();
|
|
|
|
|
float out_rate_kilobytes_per_sec = static_cast<float>(bytesOut - nLastBytesOut) / timer->interval();
|
|
|
|
|
vSamplesIn.push_front(in_rate_kilobytes_per_sec);
|
|
|
|
|
vSamplesOut.push_front(out_rate_kilobytes_per_sec);
|
|
|
|
|
nLastBytesIn = bytesIn;
|
|
|
|
|
nLastBytesOut = bytesOut;
|
|
|
|
|
|
|
|
|
|