Update README.md
add more syntax
This commit is contained in:
13
README.md
13
README.md
@@ -5,9 +5,8 @@ A script that uses gnuplot to plot `iperf3` output in realtime.
|
||||
## iperf3
|
||||
|
||||
|
||||
```
|
||||
```bash
|
||||
iperf3 -i $PINTERVAL -R -t $PTIME -f k -c $PERFHOST
|
||||
|
||||
```
|
||||
|
||||
`-i` is the interval in Seconds. Can be a float like `0.1`
|
||||
@@ -28,9 +27,8 @@ There exists a [list of public iperf servers](https://iperf.fr/iperf-servers.php
|
||||
|
||||
´iperf3` seems to buffer its `stdout`. A tool named `stdbuf` helps achieving realtime output, so the data can be piped into the next tool.
|
||||
|
||||
```
|
||||
```bash
|
||||
stdbuf -o0 iperf3 -i $PINTERVAL -R -t $PTIME -f k -c $PERFHOST
|
||||
|
||||
```
|
||||
|
||||
`-o` refers to the `STDOUT` (there is also `-i` for `STDIN` and `-e` for `STDERR`). `0` will turn buffering off. `L` would enable Line Buffering.
|
||||
@@ -43,7 +41,7 @@ stdbuf -o0 iperf3 -i $PINTERVAL -R -t $PTIME -f k -c $PERFHOST
|
||||
|
||||
iperf3 example output:
|
||||
|
||||
```
|
||||
```bash
|
||||
iperf3 -c 192.168.2.70 -f k -t 2
|
||||
Connecting to host 192.168.2.70, port 5201
|
||||
[ 5] local 192.168.2.199 port 59798 connected to 192.168.2.70 port 5201
|
||||
@@ -60,7 +58,7 @@ iperf Done.
|
||||
```
|
||||
|
||||
|
||||
```
|
||||
```bash
|
||||
awk '/sec/&&!/receiver/&&!/sender/ {print $7}'
|
||||
```
|
||||
|
||||
@@ -80,7 +78,7 @@ So this would result in
|
||||
|
||||
`feedgnuplot` is a wrapper that makes it simpler to feed data to `gnuplot` in real time.
|
||||
|
||||
```
|
||||
```bash
|
||||
feedgnuplot --lines --stream --ylabel 'KBytes/sec' --xlabel 'seconds'
|
||||
```
|
||||
|
||||
@@ -97,7 +95,6 @@ feedgnuplot --lines --stream --ylabel 'KBytes/sec' --xlabel 'seconds'
|
||||
|
||||
```bash
|
||||
stdbuf -o0 iperf3 -i $PINTERVAL -R -t $PTIME -f k -c $PERFHOST | stdbuf -o0 awk '/sec/&&!/receiver/&&!/sender/ {print $7}' | stdbuf -o0 feedgnuplot --lines --stream $PINTERVAL --ylabel 'Kbit/s' --xlabel "$PINTERVAL seconds"
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user