From 92c390f5d4620041b4ddd760b2292fe86ff17b99 Mon Sep 17 00:00:00 2001 From: DogDu Date: Sat, 26 Jul 2025 21:15:02 +0800 Subject: [PATCH 1/5] fix benchmark build fail #664 Signed-off-by: DogDu --- benchmark/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/Cargo.toml b/benchmark/Cargo.toml index 013aed50..c4cb4dba 100644 --- a/benchmark/Cargo.toml +++ b/benchmark/Cargo.toml @@ -22,7 +22,7 @@ rand = "0.8" rand_distr = "0.4" rand_xorshift = "0.3" futures-timer = "3.0" -clap = "4.5" +clap = { version = "4.5", features = ["derive"] } log = "0.4" slog = "2.0" slog-async = "2.1" From 6f7f7a366dc81ab639df6eb6b06bb774f4f81655 Mon Sep 17 00:00:00 2001 From: DogDu Date: Sun, 27 Jul 2025 15:02:34 +0800 Subject: [PATCH 2/5] fix benchmark build fail #664, add the argument '--driver_port' Signed-off-by: DogDu --- benchmark/src/main.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/benchmark/src/main.rs b/benchmark/src/main.rs index 3e25edbb..d2db86ad 100644 --- a/benchmark/src/main.rs +++ b/benchmark/src/main.rs @@ -21,15 +21,19 @@ const LOG_FILE: &str = "GRPCIO_BENCHMARK_LOG_FILE"; /// /// ref http://www.grpc.io/docs/guides/benchmarking.html. #[derive(Parser)] +#[group(required = true, multiple = false)] struct WorkerCli { /// The port the worker should listen on. For example, 8080 - #[arg(long)] - driver_port: Option, + #[arg(id = "driver_port", long)] + driver_port0: Option, + /// The port the worker should listen on. For example, 8080 + #[arg(id = "driver-port", long)] + driver_port1: Option, } fn main() { let cli = WorkerCli::parse(); - let port = cli.driver_port.unwrap_or(8080); + let port = cli.driver_port0.unwrap_or(cli.driver_port1.unwrap_or(32766)); let _log_guard = init_log( env::var(LOG_FILE) From d2a9db5f2bbbd356e748c6eac75cd3e90ec190ae Mon Sep 17 00:00:00 2001 From: DogDu Date: Sun, 27 Jul 2025 15:41:34 +0800 Subject: [PATCH 3/5] update benchmark/README.md Signed-off-by: DogDu --- benchmark/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/benchmark/README.md b/benchmark/README.md index 2d360043..42f68a06 100644 --- a/benchmark/README.md +++ b/benchmark/README.md @@ -27,8 +27,10 @@ $ cargo build -p benchmark --release ``` $ cd ../grpc +$ git submodule update --init $ python3 tools/run_tests/run_performance_tests.py -l rust ``` +The recommended python version is 3.10 Checkout `python3 tools/run_tests/run_performance_tests.py --help` to see custom options. From 96abf73160af79915ce75447dd639e06e00f1514 Mon Sep 17 00:00:00 2001 From: DogDu Date: Sun, 27 Jul 2025 15:46:37 +0800 Subject: [PATCH 4/5] fix default port Signed-off-by: DogDu --- benchmark/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/src/main.rs b/benchmark/src/main.rs index d2db86ad..bea728d2 100644 --- a/benchmark/src/main.rs +++ b/benchmark/src/main.rs @@ -33,7 +33,7 @@ struct WorkerCli { fn main() { let cli = WorkerCli::parse(); - let port = cli.driver_port0.unwrap_or(cli.driver_port1.unwrap_or(32766)); + let port = cli.driver_port0.unwrap_or(cli.driver_port1.unwrap_or(8080)); let _log_guard = init_log( env::var(LOG_FILE) From fc49b37fbb7edf7e82c80bd1451ea0bc6c5f1f39 Mon Sep 17 00:00:00 2001 From: DogDu Date: Sun, 27 Jul 2025 15:56:35 +0800 Subject: [PATCH 5/5] update benchmark/README.md Signed-off-by: DogDu --- benchmark/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/benchmark/README.md b/benchmark/README.md index 42f68a06..b8804669 100644 --- a/benchmark/README.md +++ b/benchmark/README.md @@ -17,6 +17,7 @@ $ git clone https://github.com/pingcap/grpc.git 3. Build benchmark +`grpc` and `grpc-rs` need to be in the same folder ``` $ cd grpc-rs $ cargo xtask submodule