Currently the top level directory contains basically all of the code
for the crypto package. This PR moves the crypto code into submodules
in a similar manner to what `golang/x/crypto` does. This improves code
organization.
Ref discussion: https://github.com/tendermint/tendermint/pull/1966Closes#1956
* tools/tm-bench: Don't count the first block if its empty
* Try melekes suggestion
* Fix getting the start time so the first block is no longer empty
* Fix changelog entry
* Make code smell better
* tools/tmbench: Fix the end time being used for statistics calculation
Previously we were using the time at which all connections closed in statistics, not
the time after {duration} seconds.
* Use waitgroups for starting up
At larger tx sizes (e.g. > 10000) we were spending non-neglible
amounts of time in tx creation, due to making the final bytes random.
The slower the send loop, the less accurate it is at measuring the time
tendermint took. (As we can't reach the promised contract of the given rate)
There really isn't much need for that randomness, so this PR makes it
such that only the txNumber gets bumped between txs from the same
connection, thereby improving sendloop speed and accuracy.
* tmbench: Make it more resilient to WSConn breaking
This commit changes the behavior of a broken connection from calling
os.Exit, to instead killing that connection. This also improves
the debug logging, by specifying connection index within errors.
* Rename connStatus to connsBroken
* change logging level
* tmbench: Make sendloop act in one second segments
Previous behaviour was to make the sendloop send all its messages
and then time how long that took. (Possibly waiting if too fast)
This has the same operation when too fast, but stops the loop
after one second. This is useful if a large tx amount is specified
and the ping doesn't get executed. Tmbench no longer crashes on
large rates.
* Update Readme
- Initialize random with current time as seed so transaction messages are different at every run
- Added hash of hostname to make transactions coming from different hosts different in every case
- Added current time to transaction to make sure that messages are different even if random numbers are the same in subsequent runs
- Shortened the transaction size to 64 bytes from the original 250
Also:
- use go-kit/log
Reasoning:
I found that we just don't need this layer of abstraction here. Plus
go-rpc is buggy and lacking proper closing of ws connections.