Skip to Content.
Sympa Menu

ndt-dev - [ndt-dev] [ndt] r1196 committed - Fix to download/upload speeds displaying

Subject: NDT-DEV email list created

List archive

[ndt-dev] [ndt] r1196 committed - Fix to download/upload speeds displaying


Chronological Thread 
  • From:
  • To:
  • Subject: [ndt-dev] [ndt] r1196 committed - Fix to download/upload speeds displaying
  • Date: Wed, 11 Mar 2015 14:05:41 +0000

Revision: 1196
Author:

Date: Wed Mar 11 14:05:20 2015 UTC
Log: Fix to download/upload speeds displaying

https://code.google.com/p/ndt/source/detail?r=1196

Modified:
/branches/Issue173/HTML5-frontend/script.js
/branches/Issue173/HTML5-frontend/widget.html

=======================================
--- /branches/Issue173/HTML5-frontend/script.js Wed Mar 11 13:17:14 2015 UTC
+++ /branches/Issue173/HTML5-frontend/script.js Wed Mar 11 14:05:20 2015 UTC
@@ -196,8 +196,8 @@
debug("SHOW RESULTS");
debug('Testing complete');

- document.getElementById('upload-speed').innerHTML = uploadSpeed().toPrecision(2);
- document.getElementById('download-speed').innerHTML = downloadSpeed().toPrecision(2);
+ printDownloadSpeed();
+ printUploadSpeed();
document.getElementById('latency').innerHTML = averageRoundTrip().toPrecision(2);
document.getElementById('jitter').innerHTML = jitter().toPrecision(2);
document.getElementById("test-details").innerHTML = testDetails();
@@ -414,6 +414,30 @@
if (simulate) return 0;
return parseFloat(testNDT().get_PcBuffSpdLimit());
}
+
+function printDownloadSpeed() {
+ var downloadSpeedVal = downloadSpeed();
+ if (downloadSpeedVal >= 1024) {
+ downloadSpeedVal = parseFloat(downloadSpeedVal/1024);
+ document.getElementById('download-speed').innerHTML = downloadSpeedVal.toFixed(2);
+ document.getElementById('download-speed-units').innerHTML = 'gb/s';
+ } else {
+ document.getElementById('download-speed').innerHTML = downloadSpeedVal.toFixed(2);
+ document.getElementById('download-speed-units').innerHTML = 'mb/s';
+ }
+}
+
+function printUploadSpeed() {
+ var uploadSpeedVal = uploadSpeed(false);
+ if (uploadSpeedVal >= 1024) {
+ uploadSpeedVal = parseFloat(uploadSpeedVal/1024);
+ document.getElementById('upload-speed').innerHTML = uploadSpeedVal.toFixed(2);
+ document.getElementById('upload-speed-units').innerHTML = 'gb/s';
+ } else {
+ document.getElementById('upload-speed').innerHTML = uploadSpeedVal.toFixed(2);
+ document.getElementById('upload-speed-units').innerHTML = 'mb/s';
+ }
+}

function testDetails() {
if (simulate) return 'Test details';
=======================================
--- /branches/Issue173/HTML5-frontend/widget.html Wed Mar 11 13:17:14 2015 UTC
+++ /branches/Issue173/HTML5-frontend/widget.html Wed Mar 11 14:05:20 2015 UTC
@@ -96,7 +96,7 @@
<h3>Upload speed</h3>
<p>
<span class="number" id="upload-speed">0.00</span>
- <span class="units">mb/s</span>
+ <span class="units" id="upload-speed-units">mb/s</span>
</p>
</div>

@@ -104,7 +104,7 @@
<h3>Download speed</h3>
<p>
<span class="number" id="download-speed">0.00</span>
- <span class="units">mb/s</span>
+ <span class="units" id="download-speed-units">mb/s</span>
</div>

<div class="other">


  • [ndt-dev] [ndt] r1196 committed - Fix to download/upload speeds displaying, ndt, 03/11/2015

Archive powered by MHonArc 2.6.16.

Top of Page