2018-06-11 10:48:42 +00:00
|
|
|
/*
|
|
|
|
Package benchmarks contains tests that can be used
|
|
|
|
to run benchmarks and stress tests of our cluster components.
|
|
|
|
|
|
|
|
|
|
|
|
Example usage:
|
|
|
|
|
|
|
|
1. Start a Whisper node with mail server capability:
|
2018-09-13 16:31:29 +00:00
|
|
|
./build/bin/statusd -c mailserver-config.json
|
|
|
|
|
|
|
|
where mailserver-config.json contains:
|
|
|
|
``` json
|
|
|
|
{
|
|
|
|
"NetworkId": 4,
|
|
|
|
"DataDir": "./ethereumtest/rinkeby_rpc",
|
2018-09-24 18:07:34 +00:00
|
|
|
"BackupDisabledDataDir": "./ethereumtest/rinkeby_rpc",
|
2018-09-13 16:31:29 +00:00
|
|
|
"KeyStoreDir": "./ethereumtest/keystore",
|
|
|
|
"MaxPeers": 100,
|
|
|
|
"LogLevel": "DEBUG",
|
|
|
|
"WhisperConfig": {
|
|
|
|
"Enabled": true,
|
|
|
|
"EnableMailServer": true,
|
|
|
|
"DataDir": "./ethereumtest/wnode",
|
|
|
|
"MinimumPoW": 0.002,
|
|
|
|
"MailServerPassword": "status-offline-inbox"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2018-06-11 10:48:42 +00:00
|
|
|
2. Generate some messages:
|
|
|
|
go test -v -timeout=30s -run TestSendMessages ./t/benchmarks \
|
|
|
|
-peerurl=$ENODE_ADDR \
|
|
|
|
-msgcount=200 \
|
|
|
|
-msgbatchsize=50
|
|
|
|
3. Retrieve them from the mail server:
|
|
|
|
go test -v -timeout=30s -parallel 20 \
|
|
|
|
-run TestConcurrentMailserverPeers
|
|
|
|
./t/benchmarks \
|
|
|
|
-peerurl=$ENODE_ADDR \
|
|
|
|
-msgcount=200
|
|
|
|
|
|
|
|
The result of the last command will tell you how long it took to
|
|
|
|
retrieve 200 messages with 20 concurrent peers (20 * 200 messages
|
|
|
|
in total).
|
|
|
|
|
|
|
|
The result may be affected due to limitations of the host
|
|
|
|
on which it was called. It's recommended running mail server
|
|
|
|
on a different machine and running the third command
|
|
|
|
from some beefy server.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package benchmarks
|