mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
WIP: aquatic_http_load_test: clean up config structs
This commit is contained in:
parent
da3b2bcd8c
commit
ff6eddfc85
4 changed files with 26 additions and 79 deletions
|
|
@ -14,8 +14,8 @@ pub fn create_random_request(
|
|||
rng: &mut impl Rng,
|
||||
) -> Request {
|
||||
let weights = vec![
|
||||
config.handler.weight_announce as u32,
|
||||
config.handler.weight_scrape as u32,
|
||||
config.torrents.weight_announce as u32,
|
||||
config.torrents.weight_scrape as u32,
|
||||
];
|
||||
|
||||
let items = vec![
|
||||
|
|
@ -47,7 +47,7 @@ fn create_announce_request(
|
|||
rng: &mut impl Rng,
|
||||
) -> Request {
|
||||
let (event, bytes_left) = {
|
||||
if rng.gen_bool(config.handler.peer_seeder_probability) {
|
||||
if rng.gen_bool(config.torrents.peer_seeder_probability) {
|
||||
(AnnounceEvent::Completed, 0)
|
||||
} else {
|
||||
(AnnounceEvent::Started, 50)
|
||||
|
|
@ -93,7 +93,7 @@ fn select_info_hash_index(
|
|||
state: &LoadTestState,
|
||||
rng: &mut impl Rng,
|
||||
) -> usize {
|
||||
pareto_usize(rng, &state.pareto, config.handler.number_of_torrents - 1)
|
||||
pareto_usize(rng, &state.pareto, config.torrents.number_of_torrents - 1)
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue