Skip to content

Commit 6087e4f

Browse files
committed
feat: added benchmarking binary for torrent repository
1 parent a3274dc commit 6087e4f

File tree

15 files changed

+1110
-121
lines changed

15 files changed

+1110
-121
lines changed

Cargo.lock

+97
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+4-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ version = "3.0.0-alpha.12-develop"
3232
[dependencies]
3333
aquatic_udp_protocol = "0"
3434
async-trait = "0"
35-
axum = "0.6"
35+
axum = { version = "0.6", features = ["macros"] }
3636
axum-client-ip = "0.4"
3737
axum-server = { version = "0", features = ["tls-rustls"] }
3838
binascii = "0"
@@ -68,16 +68,18 @@ tower-http = { version = "0.4", features = ["compression-full"] }
6868
uuid = { version = "1", features = ["v4"] }
6969

7070
[dev-dependencies]
71+
criterion = { version = "0.5.1", features = ["async_tokio"] }
7172
local-ip-address = "0"
7273
mockall = "0"
74+
once_cell = "1.18.0"
7375
reqwest = { version = "0", features = ["json"] }
7476
serde_bytes = "0"
7577
serde_repr = "0"
7678
serde_urlencoded = "0"
7779
torrust-tracker-test-helpers = { version = "3.0.0-alpha.12-develop", path = "packages/test-helpers" }
7880

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

8284
[profile.dev]
8385
debug = 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[package]
2+
name = "torrust-torrent-repository-benchmarks"
3+
authors.workspace = true
4+
categories.workspace = true
5+
description.workspace = true
6+
documentation.workspace = true
7+
edition.workspace = true
8+
homepage.workspace = true
9+
keywords.workspace = true
10+
license.workspace = true
11+
publish.workspace = true
12+
repository.workspace = true
13+
rust-version.workspace = true
14+
version.workspace = true
15+
16+
[dependencies]
17+
aquatic_udp_protocol = "0.8.0"
18+
clap = { version = "4.4.8", features = ["derive"] }
19+
futures = "0.3.29"
20+
tokio = { version = "1", features = ["macros", "net", "rt-multi-thread", "signal", "sync"] }
21+
torrust-tracker = { path = "../../" }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
use clap::Parser;
2+
3+
#[derive(Parser, Debug)]
4+
#[command(author, version, about, long_about = None)]
5+
pub struct Args {
6+
/// Amount of benchmark worker threads
7+
#[arg(short, long)]
8+
pub threads: usize,
9+
/// Amount of time in ns a thread will sleep to simulate a client response after handling a task
10+
#[arg(short, long)]
11+
pub sleep: Option<u64>,
12+
/// Compare with old implementations of the torrent repository
13+
#[arg(short, long)]
14+
pub compare: Option<bool>,
15+
}

0 commit comments

Comments
 (0)