Merge branch 'master' into cpu-pinning-2022-03-30

This commit is contained in:
Joakim Frostegård 2022-04-04 22:49:25 +02:00
commit 908e18360c
63 changed files with 2513 additions and 446 deletions

View file

@ -13,10 +13,10 @@ readme = "../README.md"
name = "aquatic_http_load_test"
[dependencies]
aquatic_cli_helpers = "0.2.0"
aquatic_common = { version = "0.2.0", features = ["with-glommio"] }
aquatic_http_protocol = "0.2.0"
aquatic_toml_config = "0.2.0"
aquatic_cli_helpers = { version = "0.2.0", path = "../aquatic_cli_helpers" }
aquatic_common = { version = "0.2.0", path = "../aquatic_common", features = ["with-glommio"] }
aquatic_http_protocol = { version = "0.2.0", path = "../aquatic_http_protocol" }
aquatic_toml_config = { version = "0.2.0", path = "../aquatic_toml_config" }
anyhow = "1"
futures-lite = "1"

View file

@ -19,6 +19,8 @@ pub struct Config {
/// opened as quickly as possible, which is useful when the tracker
/// does not keep connections alive.
pub connection_creation_interval_ms: u64,
/// Announce/scrape url suffix. Use `/my_token/` to get `/announce/my_token/`
pub url_suffix: String,
pub duration: usize,
pub torrents: TorrentConfig,
pub cpu_pinning: CpuPinningConfigDesc,
@ -56,6 +58,7 @@ impl Default for Config {
num_workers: 1,
num_connections: 128,
connection_creation_interval_ms: 10,
url_suffix: "".into(),
duration: 0,
torrents: TorrentConfig::default(),
cpu_pinning: Default::default(),

View file

@ -135,7 +135,7 @@ impl Connection {
let request =
create_random_request(&self.config, &self.load_test_state, &mut self.rng);
request.write(&mut self.tls.writer())?;
request.write(&mut self.tls.writer(), self.config.url_suffix.as_bytes())?;
self.queued_responses += 1;
self.send_new_request = false;
@ -213,9 +213,7 @@ impl Connection {
}
if let Some(body_start_index) = opt_body_start_index {
let interesting_bytes = &interesting_bytes[body_start_index..];
match Response::from_bytes(interesting_bytes) {
match Response::from_bytes(&interesting_bytes[body_start_index..]) {
Ok(response) => {
match response {
Response::Announce(_) => {

View file

@ -46,8 +46,9 @@ fn create_announce_request(config: &Config, state: &LoadTestState, rng: &mut imp
event,
key: None,
numwant: None,
compact: true,
port: rng.gen(),
bytes_uploaded: 0,
bytes_downloaded: 0,
})
}