Skip to content

Commit

Permalink
Save experiment script files.
Browse files Browse the repository at this point in the history
  • Loading branch information
jerry73204 committed Mar 6, 2024
1 parent e6363cd commit 4c37fc5
Show file tree
Hide file tree
Showing 14 changed files with 1,764 additions and 0 deletions.
1 change: 1 addition & 0 deletions latency_test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/result/
2 changes: 2 additions & 0 deletions latency_test/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
cargo build --example z_ping --example z_pong --profile fast
4 changes: 4 additions & 0 deletions latency_test/config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export SUB_IP=127.0.0.1
export port_base=7000
export payload=1024
export priorities=(1 2 3)
420 changes: 420 additions & 0 deletions latency_test/ping.json5.in

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions latency_test/ping.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -e
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd "$script_dir"

source config.sh

dt="$(date '+%Y-%m-%d-%H-%M-%S')"
out_dir="result/$dt"

mkdir -p result
mkdir "$out_dir"

for prio in ${priorities[@]}; do
export PORT=$((port_base+prio))
config_file="ping.$PORT.json5"
envsubst < ping.json5.in > "$config_file"
echo "../target/fast/examples/z_ping_prio $payload -c \"$config_file\" | tee \"${out_dir}/prio-${prio}.payload-${payload}.txt\""
done | parallel --lb -j0
420 changes: 420 additions & 0 deletions latency_test/pong.json5.in

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions latency_test/pong.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -e
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd "$script_dir"

source config.sh

for prio in ${priorities[@]}; do
export PORT=$((port_base+prio))
config_file="pong.$PORT.json5"
envsubst < pong.json5.in > "$config_file"
echo "../target/fast/examples/z_pong_prio -c \"$config_file\" --no-stdin"
done | parallel --lb -j0
1 change: 1 addition & 0 deletions throughput_test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/result/
2 changes: 2 additions & 0 deletions throughput_test/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
cargo build --example z_pub_thr --example z_sub_thr --profile fast
4 changes: 4 additions & 0 deletions throughput_test/config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export SUB_IP=192.168.13.1
export port_base=7000
export payload=1024
export priorities=(1 2 3)
420 changes: 420 additions & 0 deletions throughput_test/pub.json5.in

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions throughput_test/pub.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -e
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd "$script_dir"

source config.sh

# payload="$1"
# shift || {
# echo "Usage: $0 PAYLOAD_SIZE PRIORITY..." >&2
# exit 1
# }

for prio in ${priorities[@]}; do
export PORT=$((port_base+prio))
config_file="pub.$PORT.json5"
envsubst < pub.json5.in > "$config_file"
echo ../target/fast/examples/z_pub_prio "$payload" -c "$config_file" -p "$prio"
done | parallel --lb -j0
420 changes: 420 additions & 0 deletions throughput_test/sub.json5.in

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions throughput_test/sub.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -e
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd "$script_dir"

source config.sh

dt="$(date '+%Y-%m-%d-%H-%M-%S')"
out_dir="result/$dt"

mkdir -p result
mkdir "$out_dir"

for prio in ${priorities[@]}; do
export PORT=$((port_base+prio))
config_file="sub.$PORT.json5"
envsubst < sub.json5.in > "$config_file"
echo "../target/fast/examples/z_sub_prio -c \"$config_file\" --no-stdin | tee \"${out_dir}/prio-${prio}.payload-${payload}.txt\""
done | parallel --lb -j0

0 comments on commit 4c37fc5

Please sign in to comment.