0

I am using iPerf3 to measure throughput between two remote devices. The output of my iPerf command is given below --

[  4]   0.00-0.20   sec   122 KBytes  4.98 Mbits/sec    7   29.7 KBytes       
[  4]   0.20-0.40   sec   110 KBytes  4.52 Mbits/sec    0   33.9 KBytes       
[  4]   0.40-0.60   sec   112 KBytes  4.58 Mbits/sec    1   25.5 KBytes       
[  4]   0.60-0.80   sec  84.8 KBytes  3.48 Mbits/sec    0   26.9 KBytes       
[  4]   0.80-1.00   sec   113 KBytes  4.63 Mbits/sec    0   26.9 KBytes       
[  4]   1.00-1.20   sec   113 KBytes  4.63 Mbits/sec    0   28.3 KBytes       
[  4]   1.20-1.40   sec  84.8 KBytes  3.47 Mbits/sec    0   29.7 KBytes       
[  4]   1.40-1.60   sec   113 KBytes  4.63 Mbits/sec    0   31.1 KBytes       
[  4]   1.60-1.80   sec   113 KBytes  4.63 Mbits/sec    0   32.5 KBytes       
[  4]   1.80-2.00   sec  84.8 KBytes  3.48 Mbits/sec    0   33.9 KBytes       
[  4]   2.00-2.20   sec   113 KBytes  4.63 Mbits/sec    0   35.4 KBytes       
[  4]   2.20-2.40   sec   116 KBytes  4.75 Mbits/sec    2   26.9 KBytes       
[  4]   2.40-2.60   sec  84.8 KBytes  3.47 Mbits/sec    0   28.3 KBytes       
[  4]   2.60-2.80   sec   113 KBytes  4.63 Mbits/sec    0   31.1 KBytes       
[  4]   2.80-3.00   sec  84.8 KBytes  3.47 Mbits/sec    0   31.1 KBytes       
[  4]   3.00-3.20   sec   113 KBytes  4.63 Mbits/sec    0   32.5 KBytes       
[  4]   3.20-3.40   sec  84.8 KBytes  3.47 Mbits/sec    1   28.3 KBytes       
[  4]   3.40-3.60   sec   115 KBytes  4.69 Mbits/sec    0   25.5 KBytes       
[  4]   3.60-3.80   sec   113 KBytes  4.63 Mbits/sec    0   26.9 KBytes       
[  4]   3.80-4.00   sec   113 KBytes  4.63 Mbits/sec    0   26.9 KBytes       
[  4]   4.00-4.20   sec  84.8 KBytes  3.48 Mbits/sec    0   28.3 KBytes       
[  4]   4.20-4.40   sec   113 KBytes  4.63 Mbits/sec    0   29.7 KBytes       
[  4]   4.40-4.60   sec   113 KBytes  4.63 Mbits/sec    0   31.1 KBytes       
[  4]   4.60-4.80   sec  84.8 KBytes  3.47 Mbits/sec    0   32.5 KBytes       
[  4]   4.80-5.00   sec   116 KBytes  4.75 Mbits/sec    0   33.9 KBytes       
[  4]   5.00-5.20   sec   102 KBytes  4.17 Mbits/sec    1   26.9 KBytes       
[  4]   5.20-5.40   sec  84.8 KBytes  3.47 Mbits/sec    0   28.3 KBytes       
[  4]   5.40-5.60   sec   113 KBytes  4.63 Mbits/sec    0   29.7 KBytes       
[  4]   5.60-5.80   sec   113 KBytes  4.63 Mbits/sec    0   31.1 KBytes       
[  4]   5.80-6.00   sec  91.9 KBytes  3.76 Mbits/sec    0   32.5 KBytes       
[  4]   6.00-6.20   sec   113 KBytes  4.64 Mbits/sec    0   32.5 KBytes       
[  4]   6.20-6.40   sec  84.8 KBytes  3.47 Mbits/sec    0   33.9 KBytes       
[  4]   6.40-6.60   sec   123 KBytes  5.04 Mbits/sec    1   24.0 KBytes       
[  4]   6.60-6.80   sec  84.8 KBytes  3.48 Mbits/sec    0   26.9 KBytes       
[  4]   6.80-7.00   sec   113 KBytes  4.63 Mbits/sec    0   28.3 KBytes       
[  4]   7.00-7.20   sec   113 KBytes  4.63 Mbits/sec    0   29.7 KBytes       
[  4]   7.20-7.40   sec   113 KBytes  4.63 Mbits/sec    0   31.1 KBytes       
[  4]   7.40-7.60   sec  84.8 KBytes  3.47 Mbits/sec    0   32.5 KBytes       
[  4]   7.60-7.80   sec   113 KBytes  4.63 Mbits/sec    0   32.5 KBytes       
[  4]   7.80-8.00   sec  91.9 KBytes  3.76 Mbits/sec    1   24.0 KBytes       
[  4]   8.00-8.20   sec  84.8 KBytes  3.48 Mbits/sec    0   26.9 KBytes       
[  4]   8.20-8.40   sec   113 KBytes  4.63 Mbits/sec    0   28.3 KBytes       
[  4]   8.40-8.60   sec   113 KBytes  4.63 Mbits/sec    0   29.7 KBytes       
[  4]   8.60-8.80   sec  84.8 KBytes  3.48 Mbits/sec    0   31.1 KBytes       
[  4]   8.80-9.00   sec   113 KBytes  4.63 Mbits/sec    0   32.5 KBytes       
[  4]   9.00-9.20   sec  84.8 KBytes  3.48 Mbits/sec    0   32.5 KBytes       
[  4]   9.20-9.40   sec   120 KBytes  4.92 Mbits/sec    1   24.0 KBytes       
[  4]   9.40-9.60   sec  84.8 KBytes  3.48 Mbits/sec    0   26.9 KBytes       
[  4]   9.60-9.80   sec   113 KBytes  4.63 Mbits/sec    0   28.3 KBytes       
[  4]   9.80-10.00  sec   113 KBytes  4.63 Mbits/sec    0   29.7 KBytes `

For each output line I would like to put a time-stamp before.

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232

1 Answers1

1

You can use the -T option with iperf3 to add a string to the start of each line of iperf, though unfortunately, if that string contains a command (such as date) it will only use the date when the command was initially run.

As such, the only way short of a script to do this would be a quick and dirty for in loop, running iperf for 1 packet at a time:

┌─[root@Fedora]─[~]─[03:25 pm]
└─[$]› for i in {1..30}; do iperf3 -c 192.168.0.1 -i 1 -t 1 -T $(date "+%H:%M:%S ") | grep -A1 Interval | grep -v Interval ; done
15:26:26 :  [  4]   0.00-1.00   sec  8.23 MBytes  69.0 Mbits/sec    8    271 KBytes
15:26:26 :  [  4]   0.00-1.00   sec  8.23 MBytes  69.0 Mbits/sec    8             sender
15:26:27 :  [  4]   0.00-1.00   sec  12.4 MBytes   104 Mbits/sec  219    733 KBytes
15:26:27 :  [  4]   0.00-1.00   sec  12.4 MBytes   104 Mbits/sec  219             sender
15:26:29 :  [  4]   0.00-1.00   sec  12.5 MBytes   105 Mbits/sec  101    673 KBytes
15:26:29 :  [  4]   0.00-1.00   sec  12.5 MBytes   105 Mbits/sec  101             sender
15:26:30 :  [  4]   0.00-1.00   sec  14.0 MBytes   117 Mbits/sec    0   1.05 MBytes
15:26:30 :  [  4]   0.00-1.00   sec  14.0 MBytes   117 Mbits/sec    0             sender
15:26:32 :  [  4]   0.00-1.00   sec  12.4 MBytes   104 Mbits/sec   29    566 KBytes
15:26:32 :  [  4]   0.00-1.00   sec  12.4 MBytes   104 Mbits/sec   29             sender
15:26:33 :  [  4]   0.00-1.00   sec  14.0 MBytes   117 Mbits/sec    2    729 KBytes

Though in using this method, it would of course mean you wouldn't get the overall average results at the end. I hope that helps.

RobotJohnny
  • 1,039
  • 8
  • 18