I need to average upload and download speed using
How can I add all the received and sent datas that appear after
dstat -n, so that I can add them and find average upload and download speed over some period of time?
You could pass the arguments for delay (number of seconds) and counter (number of times) to run, and capture the output in a txt or csv file.
Check the dstat manual (see arguments section):
The above runs 10 times for every 5 seconds.
Here is how to do it. Let's say we need to average it for "2 min(120 sec)". First write it to a file named stat.txt.Refresh every second fro 120 times.
Add the columns of stat.txt
We can make a script too from these commands.