and while the above is useful when run interactively, you can suppress the progress indicator to have only the '.csv' result line returned for piping/parsing out to a file for later analysis using scripting:

Speed is a function of time. So you have to decide what time period you are measuring, 1 millisecond, 1 second, 10 seconds, etc.

This command will give you the total number of bytes downloaded and uploaded at that point in time. If you wait for your desired sampling period (say 1 second) and issue the command again you can subtract one from the other giving you the rate.

I do something similar with QoS bandwidth data. I have a script that runs continuously on the router. Every 2 seconds it collects the data and appends it to a file together with a timestamp. Then I have another process that periodically runs on a Centos server that logs into the router with FTP and transfers the file. The file is fed into an RRD database and displayed as a graph on a web page.