mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 10:45:30 +00:00
http load test: add keep_alive setting
This commit is contained in:
parent
da6180e871
commit
7215d26ff4
2 changed files with 6 additions and 0 deletions
|
|
@ -22,6 +22,7 @@ pub struct Config {
|
||||||
/// Announce/scrape url suffix. Use `/my_token/` to get `/announce/my_token/`
|
/// Announce/scrape url suffix. Use `/my_token/` to get `/announce/my_token/`
|
||||||
pub url_suffix: String,
|
pub url_suffix: String,
|
||||||
pub duration: usize,
|
pub duration: usize,
|
||||||
|
pub keep_alive: bool,
|
||||||
pub torrents: TorrentConfig,
|
pub torrents: TorrentConfig,
|
||||||
pub cpu_pinning: CpuPinningConfigDesc,
|
pub cpu_pinning: CpuPinningConfigDesc,
|
||||||
}
|
}
|
||||||
|
|
@ -60,6 +61,7 @@ impl Default for Config {
|
||||||
connection_creation_interval_ms: 10,
|
connection_creation_interval_ms: 10,
|
||||||
url_suffix: "".into(),
|
url_suffix: "".into(),
|
||||||
duration: 0,
|
duration: 0,
|
||||||
|
keep_alive: true,
|
||||||
torrents: TorrentConfig::default(),
|
torrents: TorrentConfig::default(),
|
||||||
cpu_pinning: Default::default(),
|
cpu_pinning: Default::default(),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -138,6 +138,10 @@ impl Connection {
|
||||||
loop {
|
loop {
|
||||||
self.send_request().await?;
|
self.send_request().await?;
|
||||||
self.read_response().await?;
|
self.read_response().await?;
|
||||||
|
|
||||||
|
if !self.config.keep_alive {
|
||||||
|
break Ok(());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue