diff --git a/Cargo.lock b/Cargo.lock index f5b0188..a40df33 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -22,7 +22,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9a60d744a80c30fcb657dfe2c1b22bcb3e814c1a1e3674f32bf5820b570fbff" [[package]] -name = "aquatic" +name = "aquatic_udp" version = "0.1.0" dependencies = [ "bittorrent_udp", @@ -43,10 +43,10 @@ dependencies = [ ] [[package]] -name = "aquatic_bench" +name = "aquatic_udp_bench" version = "0.1.0" dependencies = [ - "aquatic", + "aquatic_udp", "bittorrent_udp", "cli_helpers", "crossbeam-channel", @@ -60,7 +60,7 @@ dependencies = [ ] [[package]] -name = "aquatic_load_test" +name = "aquatic_udp_load_test" version = "0.1.0" dependencies = [ "bittorrent_udp", @@ -82,7 +82,7 @@ dependencies = [ name = "aquatic_ws" version = "0.1.0" dependencies = [ - "aquatic", + "aquatic_udp", "bittorrent_udp", "cli_helpers", "flume", diff --git a/Cargo.toml b/Cargo.toml index 35e70b5..f6c39dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,9 @@ [workspace] members = [ - "aquatic", - "aquatic_bench", - "aquatic_load_test", + "aquatic_udp", + "aquatic_udp_bench", + "aquatic_udp_load_test", "aquatic_ws", "bittorrent_udp", "cli_helpers", @@ -11,4 +11,4 @@ members = [ [profile.release] debug = true -lto = true \ No newline at end of file +lto = true diff --git a/aquatic/Cargo.toml b/aquatic_udp/Cargo.toml similarity index 88% rename from aquatic/Cargo.toml rename to aquatic_udp/Cargo.toml index d08e063..a7aaf30 100644 --- a/aquatic/Cargo.toml +++ b/aquatic_udp/Cargo.toml @@ -1,16 +1,16 @@ [package] -name = "aquatic" +name = "aquatic_udp" version = "0.1.0" authors = ["Joakim Frostegård "] edition = "2018" license = "Apache-2.0" [lib] -name = "aquatic" +name = "aquatic_udp" path = "src/lib/lib.rs" [[bin]] -name = "aquatic" +name = "aquatic_udp" [dependencies] bittorrent_udp = { path = "../bittorrent_udp" } @@ -29,4 +29,4 @@ serde = { version = "1", features = ["derive"] } [dev-dependencies] quickcheck = "0.9" -quickcheck_macros = "0.9" \ No newline at end of file +quickcheck_macros = "0.9" diff --git a/aquatic/src/bin/aquatic.rs b/aquatic_udp/src/bin/aquatic_udp.rs similarity index 56% rename from aquatic/src/bin/aquatic.rs rename to aquatic_udp/src/bin/aquatic_udp.rs index 3ad9b9d..65ffeee 100644 --- a/aquatic/src/bin/aquatic.rs +++ b/aquatic_udp/src/bin/aquatic_udp.rs @@ -1,4 +1,4 @@ -use aquatic; +use aquatic_udp; use cli_helpers; @@ -7,8 +7,8 @@ static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; fn main(){ - cli_helpers::run_app_with_cli_and_config::( + cli_helpers::run_app_with_cli_and_config::( "aquatic: udp bittorrent tracker", - aquatic::run, + aquatic_udp::run, ) } \ No newline at end of file diff --git a/aquatic/src/lib/common.rs b/aquatic_udp/src/lib/common.rs similarity index 100% rename from aquatic/src/lib/common.rs rename to aquatic_udp/src/lib/common.rs diff --git a/aquatic/src/lib/config.rs b/aquatic_udp/src/lib/config.rs similarity index 100% rename from aquatic/src/lib/config.rs rename to aquatic_udp/src/lib/config.rs diff --git a/aquatic/src/lib/handlers.rs b/aquatic_udp/src/lib/handlers.rs similarity index 100% rename from aquatic/src/lib/handlers.rs rename to aquatic_udp/src/lib/handlers.rs diff --git a/aquatic/src/lib/lib.rs b/aquatic_udp/src/lib/lib.rs similarity index 100% rename from aquatic/src/lib/lib.rs rename to aquatic_udp/src/lib/lib.rs diff --git a/aquatic/src/lib/network.rs b/aquatic_udp/src/lib/network.rs similarity index 100% rename from aquatic/src/lib/network.rs rename to aquatic_udp/src/lib/network.rs diff --git a/aquatic/src/lib/tasks.rs b/aquatic_udp/src/lib/tasks.rs similarity index 100% rename from aquatic/src/lib/tasks.rs rename to aquatic_udp/src/lib/tasks.rs diff --git a/aquatic_bench/Cargo.toml b/aquatic_udp_bench/Cargo.toml similarity index 73% rename from aquatic_bench/Cargo.toml rename to aquatic_udp_bench/Cargo.toml index fb25cd4..4900bdc 100644 --- a/aquatic_bench/Cargo.toml +++ b/aquatic_udp_bench/Cargo.toml @@ -1,21 +1,21 @@ [package] -name = "aquatic_bench" +name = "aquatic_udp_bench" version = "0.1.0" authors = ["Joakim Frostegård "] edition = "2018" license = "Apache-2.0" [lib] -name = "aquatic_bench" +name = "aquatic_udp_bench" [[bin]] -name = "bench_handlers" +name = "aquatic_udp_bench_handlers" [[bin]] name = "plot_pareto" [dependencies] -aquatic = { path = "../aquatic" } +aquatic_udp = { path = "../aquatic_udp" } bittorrent_udp = { path = "../bittorrent_udp" } cli_helpers = { path = "../cli_helpers" } crossbeam-channel = "0.4" @@ -25,4 +25,4 @@ num-format = "0.4" plotly = "0.4" rand = { version = "0.7", features = ["small_rng"] } rand_distr = "0.2" -serde = { version = "1", features = ["derive"] } \ No newline at end of file +serde = { version = "1", features = ["derive"] } diff --git a/aquatic_bench/src/bin/bench_handlers/announce.rs b/aquatic_udp_bench/src/bin/aquatic_udp_bench_handlers/announce.rs similarity index 97% rename from aquatic_bench/src/bin/bench_handlers/announce.rs rename to aquatic_udp_bench/src/bin/aquatic_udp_bench_handlers/announce.rs index 3bde889..efba852 100644 --- a/aquatic_bench/src/bin/bench_handlers/announce.rs +++ b/aquatic_udp_bench/src/bin/aquatic_udp_bench_handlers/announce.rs @@ -6,10 +6,10 @@ use indicatif::ProgressIterator; use rand::Rng; use rand_distr::Pareto; -use aquatic::common::*; -use aquatic::config::Config; +use aquatic_udp::common::*; +use aquatic_udp::config::Config; -use aquatic_bench::pareto_usize; +use aquatic_udp_bench::pareto_usize; use crate::common::*; use crate::config::BenchConfig; diff --git a/aquatic_bench/src/bin/bench_handlers/common.rs b/aquatic_udp_bench/src/bin/aquatic_udp_bench_handlers/common.rs similarity index 100% rename from aquatic_bench/src/bin/bench_handlers/common.rs rename to aquatic_udp_bench/src/bin/aquatic_udp_bench_handlers/common.rs diff --git a/aquatic_bench/src/bin/bench_handlers/config.rs b/aquatic_udp_bench/src/bin/aquatic_udp_bench_handlers/config.rs similarity index 100% rename from aquatic_bench/src/bin/bench_handlers/config.rs rename to aquatic_udp_bench/src/bin/aquatic_udp_bench_handlers/config.rs diff --git a/aquatic_bench/src/bin/bench_handlers/connect.rs b/aquatic_udp_bench/src/bin/aquatic_udp_bench_handlers/connect.rs similarity index 97% rename from aquatic_bench/src/bin/bench_handlers/connect.rs rename to aquatic_udp_bench/src/bin/aquatic_udp_bench_handlers/connect.rs index e227a4e..c6f589b 100644 --- a/aquatic_bench/src/bin/bench_handlers/connect.rs +++ b/aquatic_udp_bench/src/bin/aquatic_udp_bench_handlers/connect.rs @@ -5,8 +5,8 @@ use indicatif::ProgressIterator; use rand::{Rng, SeedableRng, thread_rng, rngs::SmallRng}; use std::net::SocketAddr; -use aquatic::common::*; -use aquatic::config::Config; +use aquatic_udp::common::*; +use aquatic_udp::config::Config; use crate::common::*; use crate::config::BenchConfig; diff --git a/aquatic_bench/src/bin/bench_handlers/main.rs b/aquatic_udp_bench/src/bin/aquatic_udp_bench_handlers/main.rs similarity index 97% rename from aquatic_bench/src/bin/bench_handlers/main.rs rename to aquatic_udp_bench/src/bin/aquatic_udp_bench_handlers/main.rs index 1a31690..f81b674 100644 --- a/aquatic_bench/src/bin/bench_handlers/main.rs +++ b/aquatic_udp_bench/src/bin/aquatic_udp_bench_handlers/main.rs @@ -19,9 +19,9 @@ use std::time::Duration; use num_format::{Locale, ToFormattedString}; use rand::{Rng, thread_rng, rngs::SmallRng, SeedableRng}; -use aquatic::common::*; -use aquatic::config::Config; -use aquatic::handlers; +use aquatic_udp::common::*; +use aquatic_udp::config::Config; +use aquatic_udp::handlers; use cli_helpers::run_app_with_cli_and_config; use config::BenchConfig; diff --git a/aquatic_bench/src/bin/bench_handlers/scrape.rs b/aquatic_udp_bench/src/bin/aquatic_udp_bench_handlers/scrape.rs similarity index 97% rename from aquatic_bench/src/bin/bench_handlers/scrape.rs rename to aquatic_udp_bench/src/bin/aquatic_udp_bench_handlers/scrape.rs index 5f979d9..bee40b9 100644 --- a/aquatic_bench/src/bin/bench_handlers/scrape.rs +++ b/aquatic_udp_bench/src/bin/aquatic_udp_bench_handlers/scrape.rs @@ -6,10 +6,10 @@ use indicatif::ProgressIterator; use rand::Rng; use rand_distr::Pareto; -use aquatic::common::*; -use aquatic::config::Config; +use aquatic_udp::common::*; +use aquatic_udp::config::Config; -use aquatic_bench::pareto_usize; +use aquatic_udp_bench::pareto_usize; use crate::common::*; use crate::config::BenchConfig; diff --git a/aquatic_bench/src/bin/plot_pareto.rs b/aquatic_udp_bench/src/bin/plot_pareto.rs similarity index 96% rename from aquatic_bench/src/bin/plot_pareto.rs rename to aquatic_udp_bench/src/bin/plot_pareto.rs index b78ca95..f5ab294 100644 --- a/aquatic_bench/src/bin/plot_pareto.rs +++ b/aquatic_udp_bench/src/bin/plot_pareto.rs @@ -4,7 +4,7 @@ use plotly::layout::Axis; use rand::{thread_rng, rngs::SmallRng, SeedableRng}; use rand_distr::Pareto; -use aquatic_bench::pareto_usize; +use aquatic_udp_bench::pareto_usize; fn main(){ diff --git a/aquatic_bench/src/lib.rs b/aquatic_udp_bench/src/lib.rs similarity index 100% rename from aquatic_bench/src/lib.rs rename to aquatic_udp_bench/src/lib.rs diff --git a/aquatic_load_test/Cargo.toml b/aquatic_udp_load_test/Cargo.toml similarity index 87% rename from aquatic_load_test/Cargo.toml rename to aquatic_udp_load_test/Cargo.toml index 6ec6f97..8c7b62a 100644 --- a/aquatic_load_test/Cargo.toml +++ b/aquatic_udp_load_test/Cargo.toml @@ -1,12 +1,12 @@ [package] -name = "aquatic_load_test" +name = "aquatic_udp_load_test" version = "0.1.0" authors = ["Joakim Frostegård "] edition = "2018" license = "Apache-2.0" [[bin]] -name = "aquatic_load_test" +name = "aquatic_udp_load_test" [dependencies] bittorrent_udp = { path = "../bittorrent_udp" } @@ -23,4 +23,4 @@ serde = { version = "1", features = ["derive"] } [dev-dependencies] quickcheck = "0.9" -quickcheck_macros = "0.9" \ No newline at end of file +quickcheck_macros = "0.9" diff --git a/aquatic_load_test/src/common.rs b/aquatic_udp_load_test/src/common.rs similarity index 100% rename from aquatic_load_test/src/common.rs rename to aquatic_udp_load_test/src/common.rs diff --git a/aquatic_load_test/src/handler.rs b/aquatic_udp_load_test/src/handler.rs similarity index 100% rename from aquatic_load_test/src/handler.rs rename to aquatic_udp_load_test/src/handler.rs diff --git a/aquatic_load_test/src/main.rs b/aquatic_udp_load_test/src/main.rs similarity index 100% rename from aquatic_load_test/src/main.rs rename to aquatic_udp_load_test/src/main.rs diff --git a/aquatic_load_test/src/network.rs b/aquatic_udp_load_test/src/network.rs similarity index 100% rename from aquatic_load_test/src/network.rs rename to aquatic_udp_load_test/src/network.rs diff --git a/aquatic_load_test/src/utils.rs b/aquatic_udp_load_test/src/utils.rs similarity index 100% rename from aquatic_load_test/src/utils.rs rename to aquatic_udp_load_test/src/utils.rs diff --git a/aquatic_ws/Cargo.toml b/aquatic_ws/Cargo.toml index 7d708b1..27d175b 100644 --- a/aquatic_ws/Cargo.toml +++ b/aquatic_ws/Cargo.toml @@ -14,7 +14,7 @@ name = "aquatic_ws" path = "src/bin/main.rs" [dependencies] -aquatic = { path = "../aquatic" } +aquatic_udp = { path = "../aquatic_udp" } bittorrent_udp = { path = "../bittorrent_udp" } cli_helpers = { path = "../cli_helpers" } flume = "0.7" diff --git a/aquatic_ws/src/lib/common.rs b/aquatic_ws/src/lib/common.rs index 446ab78..7cd9cd2 100644 --- a/aquatic_ws/src/lib/common.rs +++ b/aquatic_ws/src/lib/common.rs @@ -7,7 +7,7 @@ use indexmap::IndexMap; use parking_lot::Mutex; use mio::Token; -pub use aquatic::common::ValidUntil; +pub use aquatic_udp::common::ValidUntil; use crate::protocol::*; diff --git a/aquatic_ws/src/lib/handler.rs b/aquatic_ws/src/lib/handler.rs index 93d1929..fd2bd7f 100644 --- a/aquatic_ws/src/lib/handler.rs +++ b/aquatic_ws/src/lib/handler.rs @@ -5,7 +5,7 @@ use hashbrown::HashMap; use parking_lot::MutexGuard; use rand::{Rng, SeedableRng, rngs::SmallRng}; -use aquatic::handlers::{extract_response_peers}; +use aquatic_udp::handlers::extract_response_peers; use crate::common::*; use crate::protocol::*; diff --git a/scripts/bench-handlers.sh b/scripts/bench-handlers.sh deleted file mode 100755 index 904d1d5..0000000 --- a/scripts/bench-handlers.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -export RUSTFLAGS="-C target-cpu=native" - -cargo run --release --bin bench_handlers -- $@ \ No newline at end of file diff --git a/scripts/bench-udp-handlers.sh b/scripts/bench-udp-handlers.sh new file mode 100755 index 0000000..e09f1d6 --- /dev/null +++ b/scripts/bench-udp-handlers.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +export RUSTFLAGS="-C target-cpu=native" + +cargo run --release --bin aquatic_udp_bench_handlers -- $@ \ No newline at end of file diff --git a/scripts/flamegraph-aquatic-on-linux.sh b/scripts/flamegraph-aquatic-udp-on-linux.sh similarity index 94% rename from scripts/flamegraph-aquatic-on-linux.sh rename to scripts/flamegraph-aquatic-udp-on-linux.sh index 297adeb..977d0cb 100755 --- a/scripts/flamegraph-aquatic-on-linux.sh +++ b/scripts/flamegraph-aquatic-udp-on-linux.sh @@ -1,7 +1,7 @@ #!/bin/bash # Profile -perf record --call-graph=dwarf,16384 -e cpu-clock -F 997 target/release/aquatic +perf record --call-graph=dwarf,16384 -e cpu-clock -F 997 target/release/aquatic_udp # Generate flamegraph (make sure nginx is installed for stdout path) # Info: https://gist.github.com/dlaehnemann/df31787c41bd50c0fe223df07cf6eb89 diff --git a/scripts/run-server.sh b/scripts/run-aquatic-udp.sh similarity index 54% rename from scripts/run-server.sh rename to scripts/run-aquatic-udp.sh index b2534ef..b0b1e16 100755 --- a/scripts/run-server.sh +++ b/scripts/run-aquatic-udp.sh @@ -2,4 +2,4 @@ export RUSTFLAGS="-C target-cpu=native" -cargo run --release --bin aquatic -- $@ +cargo run --release --bin aquatic_udp -- $@ diff --git a/scripts/run-load-test-udp.sh b/scripts/run-load-test-udp.sh new file mode 100755 index 0000000..78a1a26 --- /dev/null +++ b/scripts/run-load-test-udp.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +export RUSTFLAGS="-C target-cpu=native" + +cargo run --release --bin aquatic_udp_load_test -- $@ diff --git a/scripts/run-load-test.sh b/scripts/run-load-test.sh deleted file mode 100755 index e982e58..0000000 --- a/scripts/run-load-test.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -export RUSTFLAGS="-C target-cpu=native" - -cargo run --release --bin aquatic_load_test -- $@ diff --git a/scripts/setup-bench-on-debian.sh b/scripts/setup-bench-on-debian.sh index 658f9cc..e42ebfd 100755 --- a/scripts/setup-bench-on-debian.sh +++ b/scripts/setup-bench-on-debian.sh @@ -53,8 +53,8 @@ cd .. git clone https://github.com/greatest-ape/aquatic.git cd aquatic export RUSTFLAGS="-C target-cpu=native" -cargo build --release --bin aquatic -cargo build --release --bin aquatic_load_test +cargo build --release --bin aquatic_udp +cargo build --release --bin aquatic_udp_load_test cd .. # Download flamegraph stuff