Fix storage tests

* reformat sources #JR1356
This commit is contained in:
Širhoe Biazhkovič
2021-11-26 18:43:23 +03:00
committed by Lawrence, Rendall
parent beb4736b86
commit 9122aefdd7
28 changed files with 1140 additions and 949 deletions

View File

@@ -4,21 +4,23 @@ This package provides the announce middleware `interval variation` which randomi
## Functionality
This middleware chooses random announces and modifies the `interval` and `min_interval` fields.
A random number of seconds are added to the `interval` field and, if desired, also to the `min_interval` field.
This middleware chooses random announces and modifies the `interval` and `min_interval` fields. A random number of
seconds are added to the `interval` field and, if desired, also to the `min_interval` field.
Note that if a response is picked for modification and `min_interval` should be changed as well, both `interval` and `min_interval` are modified by the same amount.
Note that if a response is picked for modification and `min_interval` should be changed as well, both `interval`
and `min_interval` are modified by the same amount.
## Use Case
Use this middleware to avoid recurring load spikes on the tracker.
By randomizing the announce interval, load spikes will flatten out after a few announce cycles.
Use this middleware to avoid recurring load spikes on the tracker. By randomizing the announce interval, load spikes
will flatten out after a few announce cycles.
## Configuration
This middleware provides the following parameters for configuration:
- `modify_response_probability` (float, >0, <= 1) indicates the probability by which a response will be chosen to have its announce intervals modified.
- `modify_response_probability` (float, >0, <= 1) indicates the probability by which a response will be chosen to have
its announce intervals modified.
- `max_increase_delta` (int, >0) sets an upper boundary (inclusive) for the amount of seconds added.
- `modify_min_interval` (boolean) whether to modify the `min_interval` field as well.