From 86878b3a2c6204e0f4977a4f173dacc895c1438f Mon Sep 17 00:00:00 2001 From: gop Date: Sat, 6 Apr 2024 10:20:19 -0500 Subject: [PATCH] Updating the PProf for 10 min pprof --- pprof_tool/pprof.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pprof_tool/pprof.sh b/pprof_tool/pprof.sh index ac8c6d9824..87c2a6643e 100755 --- a/pprof_tool/pprof.sh +++ b/pprof_tool/pprof.sh @@ -20,13 +20,16 @@ names=("all") # Create the new folder in traces mkdir -p "traces/$folder" -# Loop over the ports -for i in ${!ports[@]} -do - port=${ports[$i]} - name=${names[$i]} +while true; do + # Loop over the ports + for i in ${!ports[@]} + do + port=${ports[$i]} + name=${names[$i]} - # Run the go tool pprof command for each port - echo "Running pprof for port $port" - curl http://localhost:$port/debug/pprof/goroutine -o "traces/$folder/$name"_"$port"_goroutine.pb.gz + timestamp=$(date +"%Y%m%d-%H%M%S") + # Run the go tool pprof command for each port + echo "Running pprof for port $port" + curl http://localhost:$port/debug/pprof/goroutine -o "traces/$folder/$name"_"$timestamp_"$port"_goroutine.pb.gz + done done