回答編集履歴
2
改行位置の調整
test
CHANGED
@@ -72,13 +72,7 @@
|
|
72
72
|
|
73
73
|
```shell
|
74
74
|
|
75
|
-
$ iperf3 -c 192.168.10.12 \
|
75
|
+
$ iperf3 -c 192.168.10.12 -J -t 3 --get-server-output | \
|
76
|
-
|
77
|
-
-J \
|
78
|
-
|
79
|
-
-t 3 \
|
80
|
-
|
81
|
-
--get-server-output | \
|
82
76
|
|
83
77
|
jq '.intervals[].streams[] | .rtt, .snd_cwnd, .bits_per_second' | \
|
84
78
|
|
1
追加の質問部分を回答
test
CHANGED
@@ -21,3 +21,73 @@
|
|
21
21
|
|
22
22
|
|
23
23
|
ここで出てきた数値が `rtt` です。
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
## 他の結果も合わせて画面に出したい場合
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
`-J` の JSON 形式のオプションを付けて出力すると、毎回表示されている項目は、この "intervals" の "streams" 以下
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
```JSON
|
36
|
+
|
37
|
+
"intervals": [{
|
38
|
+
|
39
|
+
"streams": [{
|
40
|
+
|
41
|
+
"socket": 4,
|
42
|
+
|
43
|
+
"start": 0,
|
44
|
+
|
45
|
+
"end": 1.000113,
|
46
|
+
|
47
|
+
"seconds": 1.000113,
|
48
|
+
|
49
|
+
"bytes": 15215584,
|
50
|
+
|
51
|
+
"bits_per_second": 121710917.399750,
|
52
|
+
|
53
|
+
"retransmits": 301,
|
54
|
+
|
55
|
+
"snd_cwnd": 189688,
|
56
|
+
|
57
|
+
"rtt": 326,
|
58
|
+
|
59
|
+
"omitted": false
|
60
|
+
|
61
|
+
}],
|
62
|
+
|
63
|
+
```
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
ここから「.rtt」「.snd_cwnd」「.bits_per_second」を `jq` で抽出するには、このように実行します。
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
```shell
|
74
|
+
|
75
|
+
$ iperf3 -c 192.168.10.12 \
|
76
|
+
|
77
|
+
-J \
|
78
|
+
|
79
|
+
-t 3 \
|
80
|
+
|
81
|
+
--get-server-output | \
|
82
|
+
|
83
|
+
jq '.intervals[].streams[] | .rtt, .snd_cwnd, .bits_per_second' | \
|
84
|
+
|
85
|
+
xargs -n 3
|
86
|
+
|
87
|
+
208 209960 124086877.70698
|
88
|
+
|
89
|
+
523 160728 89108490.511791
|
90
|
+
|
91
|
+
239 225888 93330719.108345
|
92
|
+
|
93
|
+
```
|