This repository has been archived by the owner on Mar 8, 2024. It is now read-only.
forked from dominant-strategies/go-quai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
143 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
build/bin/ | ||
nodelogs/ | ||
traces/ | ||
/data/ | ||
*/config.toml | ||
*/private.key | ||
.vscode/ | ||
.idea* | ||
.idea* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
convert_to_kilobytes() { | ||
value=$1 | ||
case $value in | ||
*K) printf "%.0f" ${value%K} ;; | ||
*M) printf "%.0f" $(echo "${value%M} * 1024" | bc) ;; | ||
*G) printf "%.0f" $(echo "${value%G} * 1024 * 1024" | bc) ;; | ||
*) printf "%.0f" $(echo "$value / 1024" | bc) ;; | ||
esac | ||
} | ||
|
||
if [ "$#" -ne 1 ]; then | ||
echo "Usage: $0 pid" | ||
exit 1 | ||
fi | ||
|
||
pid=$1 | ||
start_time=$(date +%s) | ||
|
||
# Print headers | ||
echo "Elapsed_Time,PID,RSS,Stack_VSZ,Stack_Resident,Stack_Dirty,Stack_Swapped,VM_Allocate_VSZ,VM_Allocate_Resident,VM_Allocate_Dirty,VM_Allocate_Swapped" | ||
|
||
while true; do | ||
if ps -p $pid > /dev/null; then | ||
elapsed_time=$(($(date +%s) - start_time)) | ||
|
||
rss=$(ps -p $pid -o rss=) # ps prints rss in KB by default | ||
|
||
echo "$elapsed_time,$pid,$rss" | ||
else | ||
echo "Process $pid not found." | ||
exit 1 | ||
fi | ||
sleep 1 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
# Exit if no arguments were provided | ||
if [ $# -eq 0 ]; then | ||
echo "No arguments provided" | ||
exit 1 | ||
fi | ||
|
||
# Get the folder name from the argument | ||
folder=$1 | ||
|
||
# Array of ports and corresponding names | ||
# ports=("9001" "9002" "9003" "9004" "9100" "9101" "9102" "9120" "9121" "9122" "9140" "9141" "1942") | ||
# names=("PRIME" "Region_0" "Region_1" "Region_2" "Zone_0-0" "Zone_0-1" "Zone_0-2" "Zone_1-0" "Zone_1-1" "Zone_1-2" "Zone_2-0" "Zone_2-1" "Zone_2-2") | ||
|
||
# Array of ports and corresponding names | ||
ports=("8081" "8090" "8091") | ||
names=("PRIME" "Region_0" "Zone_0-0") | ||
|
||
# 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]} | ||
|
||
# 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 | ||
done |