Skip to content

Commit 3d211b8

Browse files
committed
bench: save an nsqd CPU profile while benchmarking
1 parent 213cd9d commit 3d211b8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

bench.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ popd >/dev/null
3737

3838
echo -n "PUB: "
3939
bench/bench_writer/bench_writer --size=$messageSize --batch-size=$batchSize 2>&1
40+
41+
curl -s -o cpu.pprof http://127.0.0.1:4151/debug/pprof/profile &
42+
pprof_pid=$!
43+
4044
echo -n "SUB: "
41-
bench/bench_reader/bench_reader --size=$messageSize --channel=ch 2>&1 &
42-
wait $!
45+
bench/bench_reader/bench_reader --size=$messageSize --channel=ch 2>&1
46+
47+
echo "waiting for pprof..."
48+
wait $pprof_pid

0 commit comments

Comments
 (0)