librespeed / speedtest

Self-hosted Speed Test for HTML5 and more. Easy setup, examples, configurable, mobile friendly. Supports PHP, Node, Multiple servers, and more
https://librespeed.org
GNU Lesser General Public License v3.0
12.05k stars 2.18k forks source link

Return the total amount of downloaded/uploaded bytes #627

Open berrnd opened 4 months ago

berrnd commented 4 months ago

Resubmit of #608

Hi and first thanks a lot for LibreSpeed!

I wanted to show how much data volume the upload / download test used. So I've added 2 properties to the speedtest_worker.js status data object:

This also includes data during dlGraceTime / ulGraceTime.

Could look like that (a live example is available here):

https://github.com/librespeed/speedtest/assets/2161815/4f761788-c76a-41cf-a8c1-454ee80d9268

sstidl commented 4 months ago

hi @berrnd

thank you for resubmitting. can you also provide the changes needed to actually use the new feature? i briefly looked at your code at the example but i am not the pro in reverse engineering ;-)

berrnd commented 4 months ago

I've added a new example example-singleServer-showUsedDataVolume.html (based on / an extended copy of example-singleServer-pretty.html) to showcase displaying the data amount used during the download / upload speed test.