Skip to content

Commit

Permalink
feat: added benchmarking binary for torrent repository struct
Browse files Browse the repository at this point in the history
  • Loading branch information
mickvandijke committed Nov 29, 2023
1 parent 7c22202 commit 2b56847
Show file tree
Hide file tree
Showing 15 changed files with 958 additions and 147 deletions.
145 changes: 121 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ version = "3.0.0-alpha.12-develop"
[dependencies]
aquatic_udp_protocol = "0"
async-trait = "0"
axum = "0"
axum = { version = "0", features = ["macros"] }
axum-client-ip = "0"
axum-server = { version = "0", features = ["tls-rustls"] }
binascii = "0"
Expand Down Expand Up @@ -66,16 +66,18 @@ tower-http = { version = "0", features = ["compression-full"] }
uuid = { version = "1", features = ["v4"] }

[dev-dependencies]
criterion = { version = "0.5.1", features = ["async_tokio"] }
local-ip-address = "0"
mockall = "0"
once_cell = "1.18.0"
reqwest = { version = "0", features = ["json"] }
serde_bytes = "0"
serde_repr = "0"
serde_urlencoded = "0"
torrust-tracker-test-helpers = { version = "3.0.0-alpha.12-develop", path = "packages/test-helpers" }

[workspace]
members = ["contrib/bencode", "packages/configuration", "packages/located-error", "packages/primitives", "packages/test-helpers"]
members = ["contrib/bencode", "packages/configuration", "packages/located-error", "packages/primitives", "packages/test-helpers", "packages/torrent-repository-benchmarks"]

[profile.dev]
debug = 1
Expand Down
21 changes: 21 additions & 0 deletions packages/torrent-repository-benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "torrust-torrent-repository-benchmarks"
authors.workspace = true
categories.workspace = true
description.workspace = true
documentation.workspace = true
edition.workspace = true
homepage.workspace = true
keywords.workspace = true
license.workspace = true
publish.workspace = true
repository.workspace = true
rust-version.workspace = true
version.workspace = true

[dependencies]
aquatic_udp_protocol = "0.8.0"
clap = { version = "4.4.8", features = ["derive"] }
futures = "0.3.29"
tokio = { version = "1", features = ["macros", "net", "rt-multi-thread", "signal", "sync"] }
torrust-tracker = { path = "../../" }
15 changes: 15 additions & 0 deletions packages/torrent-repository-benchmarks/src/args.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use clap::Parser;

#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
pub struct Args {
/// Amount of benchmark worker threads
#[arg(short, long)]
pub threads: usize,
/// Amount of time in ns a thread will sleep to simulate a client response after handling a task
#[arg(short, long)]
pub sleep: Option<u64>,
/// Compare with old implementations of the torrent repository
#[arg(short, long)]
pub compare: Option<bool>,
}
Loading

0 comments on commit 2b56847

Please sign in to comment.