This allows to specify a "--client" parameter in the benchmark,
which specifies the amount of clients which perform a test concurrently.
Each client uses its own thread and single-threaded runtime.
Stats are currently printed for each individual client and not aggregated.
This changes the bulk benchmark to support server->client
in addition to client->server transfers.
The default direction is set to server->client, since
this is more typically used.
In order to extend the bulk benchmark further, this change moves most
common functions out of the bulk.rs binary and into a lib.rs and stats.rs file.
Functionally there are no relevant changes.
This adds time-based yielding to the send loop in the same fashion it
had been previously added ot the receive loop.
In my performance testing this didn't show a noticeable difference - likely
because in the current benchmark the client is the bottleneck. But it should
make things more deterministic.
Without this, users of it will just be stuck and can never get work done.
Also make sure a work item is calculated to take at least 1ns, to prevent
a division by zero.
For most setters this was just a case of changing the signature to take
a `VarInt`.
`max_idle_timeout` was a bit more involved in order to maintain a usable
conversion from `Duration`. The internal representation was changed from
`Duration` from `VarInt`, and an `IdleTimeout` newtype was introduced
for the setter signature. `IdleTimeout` contains a `VarInt`-encoded
millisecond value, and has a fallible conversion from `Duration`. The
use of a newtype is preferable to a direct `Duration` -> `VarInt`
encoding since there could be other `VarInt`-encoded values in future
that use a different resolution than milliseconds.
These changes allow callers to avoid the type-level possibility of error
if they have a `VarInt` (or a value that can be converted infallibly
into one). Fallible conversion from `VarInt` is still convenient with
`TryInto`, and callers can handle the conversion errors without the
indirection of `ConfigError`.
Closes#1176.
BREAKING CHANGE: The `max_concurrent_bidi_streams`,
`max_concurrent_uni_streams`, `stream_receive_window`, and
`receive_window` methods on `TransportConfig` now take `VarInt`
arguments and return `&mut Self`. `TransportConfig::max_idle_timeout`
now takes an `IdleTimeout` argument and returns `&mut Self`.
There has been no implicit conversion to this variant since the switch
to `thiserror` (1bca0f7c), since `#[source]` does not imply `#[from]`.
There has never been any explicit construction of this variant, so it
likely became unused some time before during various configuration
refactors.
BREAKING CHANGE: The `ConnectError::Config` variant is removed.