Skip to content

Commit

Permalink
add thrift client->server test case
Browse files Browse the repository at this point in the history
Change-Id: I221057ed6384fa14b6355cd8c1bbd5d1f6fb151b
  • Loading branch information
xiaosong yang committed Apr 22, 2024
1 parent db16664 commit ccd6364
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,16 @@ curl -k -v https://localhost:6442/server2/1

####
cd ../wrk;
./wrk 'http://localhost:8402' -d 1m -c 1000 -t 1;
./wrk 'http://localhost:8403' -d 15s -c 10 -t 1;
./wrk 'http://localhost:8404' -d 15s -c 10 -t 10;
./wrk 'http://localhost:8405' -d 35s -c 80 -t 5;
./wrk 'https://localhost:6442/' -d 15s -c 10 -t 1;
./wrk 'https://localhost:6443/' -d 15s -c 10 -t 1;
./wrk 'https://localhost:6444/' -d 25s -c 80 -t 10;
./wrk 'https://localhost:6445/' -d 15s -c 10 -t 1;
### or
cd ../wrk2;
./wrk 'http://localhost:8402' -d 1m -c 1000 -t 1 -R40000 --latency;
./wrk 'http://localhost:8403' -d 15s -c 10 -t 1 -R40000 --latency;
./wrk 'http://localhost:8404' -d 15s -c 10 -t 10 -R40000 --latency;
Expand Down Expand Up @@ -152,6 +162,28 @@ curl http://localhost:8081
### manually kill the monolake process
kill -15 $(ps aux | grep 'code-coverage-monolake' | awk '{print $2}')

### thrift config
RUST_LOG=debug target/debug/code-coverage-monolake -c examples/thrift-2.toml &

### build thrift test case (client/server)

#### check out code
cd ..
git clone https://code.byted.org/rust-lang/lust
cd lust/example/

#### change in examples/unknown/src/thrift/client.rs 0.0.0.0:8081 -> 0.0.0.0:8082

#### build
cargo build

### run thrift test
cargo run --bin unknown-hello-server &
cargo run --bin unknown-hello-client

### manually kill the monolake process
kill -15 $(ps aux | grep 'code-coverage-monolake' | awk '{print $2}')

## run code coverage test for code-coverage-monolake-sync and all configs again
RUST_LOG=debug target/debug/code-coverage-monolake-sync -c examples/config.toml &

Expand Down
25 changes: 25 additions & 0 deletions examples/thrift-2.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[runtime]
runtime_type = "legacy"
worker_threads = 1
entries = 1024


[servers.thrift_proxy]
name = "thrift_proxy"
proxy_type = "thrift"
listener = { type = "socket", value = "0.0.0.0:8082" }

[[servers.thrift_proxy.routes]]
path = '/'
upstreams = [{ endpoint = { type = "socket", value = "127.0.0.1:8081" } }]

[servers.thrift_proxy_uds]
name = "thrift_proxy"
proxy_type = "thrift"
listener = { type = "unix", value = "/tmp/thrift_proxy_monolake.sock" }

[[servers.thrift_proxy_uds.routes]]
path = '/'
upstreams = [
{ endpoint = { type = "unix", value = "/tmp/thrift_server_monolake.sock" } },
]

0 comments on commit ccd6364

Please sign in to comment.