Skip to content

Commit e516ac2

Browse files
committed
Update usage documents.
1 parent c04ea41 commit e516ac2

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

doc/usage_en.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ For example, the following command uses a public MQTT broker provided by HiveMQ.
4747
`$ ./mqttloader -b tcp://broker.hivemq.com:1883 -p 1 -s 1 -m 10`
4848

4949
### Run on multiple machines
50-
You can run MQTTLoader on multiple machines, e.g., run publishers and subscribers separately on different machines.
50+
You can run MQTTLoader on multiple machines.
51+
Running both publishers and subscribers on a single machine may cause mutual influence, e.g., the subscribers' receiving load lowers the publishers' throughput.
52+
By running publishers and subscribers separately on different machines, you can avoid such mutual influence.
53+
5154
For example, on a host A, you can run MQTTLoader as follows:
5255

5356
`$ ./mqttloader -b tcp://<IP>:<PORT> -p 0 -s 1 -st 20 -n <NTP-SERVER>`
@@ -98,6 +101,9 @@ MQTTLoader starts to terminate when all of the following conditions are met.
98101
MQTTLoader also starts to terminate when the time specified by the parameter `-et` elapses, even if there are in-flight messages.
99102
Thus, `-et` should be long sufficiently.
100103

104+
If you want to do measurement with fixed time period, you can set the measurement time by the parameter `-et`.
105+
Note that you need to set sufficiently large value to the parameter `-m`.
106+
101107
By setting the parameter `-n`, MQTTLoader obtains the offset time from the specified NTP server and reflects it to calculate throughput and latency.
102108
It might be useful for running multiple MQTTLoader on different machines.
103109

@@ -121,6 +127,8 @@ Maximum latency[ms]: 81
121127
Average latency[ms]: 42.23691
122128
```
123129
For each publisher, MQTTLoader counts the number of messages sent for each second.
130+
If QoS level is set to 1 or 2, counting is done when receiving PUBACK or PUBCOMP respectively.
131+
124132
After completion, MQTTLoader collects the counted numbers from all publishers and calculates the maximum throughput, the average throughput, and the number of published messages.
125133
`Throughput[msg/s]` is the list of throughputs, which are the sum of each second for all publishers.
126134
Note that these calculation exclude the beginning and trailing seconds that have 0 messages.
@@ -159,6 +167,8 @@ Thus, when running multiple MQTTLoader on different machines (e.g., publishers o
159167
By specifying the file name with `-tf` parameter, you can obtain throughput data like the following.
160168

161169
```
170+
Measurement start time: 2020-09-01 18:33:38.122 JST
171+
Measurement end time: 2020-09-01 18:33:54.104 JST
162172
SLOT, mqttloaderclient-pub000000, mqttloaderclient-sub000000
163173
0, 11955, 11218
164174
1, 16427, 16414
@@ -173,6 +183,8 @@ The data that used to calculate the summary data in the standard output is writt
173183
By specifying the file name with `-lf` parameter, you can obtain latency data like the following.
174184

175185
```
186+
Measurement start time: 2020-09-01 18:33:38.122 JST
187+
Measurement end time: 2020-09-01 18:33:54.104 JST
176188
mqttloaderclient-sub000000, mqttloaderclient-sub000001
177189
7, 7
178190
4, 4

doc/usage_jp.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ MQTTLoaderの動作を確認するだけなら、パブリックブローカを
4848
`$ ./mqttloader -b tcp://broker.hivemq.com:1883 -p 1 -s 1 -m 10`
4949

5050
### 複数台での実行
51-
publisherとsubscriberを別マシンで動かす、等、複数台のマシン上でMQTTLoaderを動かすこともできます。
51+
複数台のマシン上でMQTTLoaderを動かすこともできます。
52+
1台のマシン上でpublisherとsubscriberを動かした場合、subscriberの受信負荷によってpublisherの送信スループットが低下する等の可能性があります。
53+
publisherとsubscriberを別マシンで動かすことで、負荷が相互に影響することを避けることができます。
54+
5255
例えば、ホストA上で以下のように実行します。
5356

5457
`$ ./mqttloader -b tcp://<IP>:<PORT> -p 0 -s 1 -st 20 -n <NTP-SERVER>`
@@ -99,6 +102,8 @@ MQTTLoaderは、以下の条件をすべて満たすと、クライアントを
99102
また、MQTTLoaderは、パラメータ`-et`によって指定される時間が経過すると、メッセージ送受信中であっても、終了します。
100103
送受信を中断したくない場合は、`-et`は長めに設定しておくと良いでしょう。
101104

105+
一定時間の測定を行いたい場合には、`-et`を用いて測定時間を設定し、`-m`で十分に大きな値を設定します。
106+
102107
パラメータ`-n`を設定すると、MQTTLoaderは指定されたNTPサーバから時刻のオフセット情報(NTPサーバ時刻からのずれ)を取得し、スループットやレイテンシの計算にそれを反映します。
103108
複数のMQTTLoaderを異なるマシン上で実行する場合に、利用を検討してください。
104109

@@ -123,6 +128,8 @@ Average latency[ms]: 42.23691
123128
```
124129

125130
MQTTLoaderは、各publisherごとに、毎秒の送信メッセージ数をカウントします。
131+
QoSレベルが1または2の場合は、それぞれ、PUBACKおよびPUBCOMPを受信したタイミングでカウントされます。
132+
126133
全てのメッセージ送信が完了したら、MQTTLoaderは全publisherからカウントしたメッセージ数の情報を集めて集計し、最大スループット、平均スループット、送信メッセージ数を計算します。
127134
`Throughput[msg/s]`の項は、スループット値の列挙です。列挙されているそれぞれの値は、各秒における全publisherの送信メッセージ数を足し合わせたものです。
128135
なお、測定開始時および終了時に送信メッセージ数が0の期間がある場合は、スループットの計算からは除外されます。
@@ -162,6 +169,8 @@ subscriberに関しても、上記と同様にして、受信メッセージの
162169
パラメータ`-tf`でファイル名を指定することで、以下のようなスループットの詳細データをファイルに書き出すことができます。
163170

164171
```
172+
Measurement start time: 2020-09-01 18:33:38.122 JST
173+
Measurement end time: 2020-09-01 18:33:44.104 JST
165174
SLOT, mqttloaderclient-pub000000, mqttloaderclient-sub000000
166175
0, 11955, 11218
167176
1, 16427, 16414
@@ -176,6 +185,8 @@ SLOT, mqttloaderclient-pub000000, mqttloaderclient-sub000000
176185
パラメータ`-lf`でファイル名を指定することで、以下のようなレイテンシの詳細データをファイルに書き出すことができます。
177186

178187
```
188+
Measurement start time: 2020-09-01 18:33:38.122 JST
189+
Measurement end time: 2020-09-01 18:33:44.104 JST
179190
mqttloaderclient-sub000000, mqttloaderclient-sub000001
180191
7, 7
181192
4, 4

0 commit comments

Comments
 (0)