Skip to content

Commit

Permalink
bench: save an nsqd CPU profile while benchmarking
Browse files Browse the repository at this point in the history
  • Loading branch information
mreiferson committed Jul 13, 2015
1 parent 213cd9d commit 3d211b8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ popd >/dev/null

echo -n "PUB: "
bench/bench_writer/bench_writer --size=$messageSize --batch-size=$batchSize 2>&1

curl -s -o cpu.pprof http://127.0.0.1:4151/debug/pprof/profile &
pprof_pid=$!

echo -n "SUB: "
bench/bench_reader/bench_reader --size=$messageSize --channel=ch 2>&1 &
wait $!
bench/bench_reader/bench_reader --size=$messageSize --channel=ch 2>&1

echo "waiting for pprof..."
wait $pprof_pid

0 comments on commit 3d211b8

Please sign in to comment.