mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 10:45:30 +00:00
aquatic_http_load_test: slowly open a number of connections
This commit is contained in:
parent
8d41d98fec
commit
b9e875ad90
1 changed files with 9 additions and 1 deletions
|
|
@ -170,6 +170,9 @@ pub fn run_socket_thread(
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut initial_sent = false;
|
let mut initial_sent = false;
|
||||||
|
let mut iter_counter = 0usize;
|
||||||
|
|
||||||
|
const CREATE_CONN_INTERVAL: usize = 2 ^ 20;
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
poll.poll(&mut events, Some(timeout))
|
poll.poll(&mut events, Some(timeout))
|
||||||
|
|
@ -201,13 +204,18 @@ pub fn run_socket_thread(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if token_counter < 1 { // Only create one connection at the moment
|
// Slowly create new connections
|
||||||
|
if token_counter < 128 && iter_counter % CREATE_CONN_INTERVAL == 0 {
|
||||||
Connection::create_and_register(
|
Connection::create_and_register(
|
||||||
config,
|
config,
|
||||||
&mut connections,
|
&mut connections,
|
||||||
&mut poll,
|
&mut poll,
|
||||||
&mut token_counter,
|
&mut token_counter,
|
||||||
).unwrap();
|
).unwrap();
|
||||||
}
|
|
||||||
|
initial_sent = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
iter_counter = iter_counter.wrapping_add(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue