Skip to content

Commit

Permalink
fix: including the log of heap_node for statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
maqi committed Jun 12, 2023
1 parent 60764cc commit ed7e5a9
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/memcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,12 @@ jobs:
# Start a heaptracked node instance to compare memory usage
- name: Start safenode with heaptrack
run: |
echo "SN_LOG is $SN_LOG"
mkdir -p ~/.safe/heapnode
heaptrack ./target/release/safenode --root-dir ~/.safe/heapnode --log-dir ~/.safe/heapnode &
sleep 10
env:
SN_LOG: "all"

# The resources file we upload may change, and with it mem consumption.
# Be aware!
Expand Down Expand Up @@ -119,16 +122,18 @@ jobs:
# get the counts, then the specific line, and then the digit count only
# then check we have an expected level of replication
# TODO: make this use an env var, or relate to testnet size
# As the heap_node using separate folder for logging,
# hence the folder input to rg needs to cover that as well.
run : |
sending_list_count=$(rg "Sending a replication list" ~/.safe/node/local-test-network -c --stats | rg "(\d+) matches" | rg "\d+" -o)
sending_list_count=$(rg "Sending a replication list" ~/.safe -c --stats | rg "(\d+) matches" | rg "\d+" -o)
echo "Sent $sending_list_count replication lists"
received_list_count=$(rg "Replicate list received from" ~/.safe/node/local-test-network -c --stats | rg "(\d+) matches" | rg "\d+" -o)
received_list_count=$(rg "Replicate list received from" ~/.safe -c --stats | rg "(\d+) matches" | rg "\d+" -o)
echo "Received $received_list_count replication lists"
fetching_attempt_count=$(rg "Fetching replication" ~/.safe/node/local-test-network -c --stats | rg "(\d+) matches" | rg "\d+" -o)
fetching_attempt_count=$(rg "Fetching replication" ~/.safe -c --stats | rg "(\d+) matches" | rg "\d+" -o)
echo "Carried out $fetching_attempt_count fetching attempts"
replication_attempt_count=$(rg "Replicating chunk" ~/.safe/node/local-test-network -c --stats | rg "(\d+) matches" | rg "\d+" -o)
replication_attempt_count=$(rg "Replicating chunk" ~/.safe -c --stats | rg "(\d+) matches" | rg "\d+" -o)
echo "Sent $replication_attempt_count chunk copies"
replication_count=$(rg "Chunk received for replication" ~/.safe/node/local-test-network -c --stats | rg "(\d+) matches" | rg "\d+" -o)
replication_count=$(rg "Chunk received for replication" ~/.safe -c --stats | rg "(\d+) matches" | rg "\d+" -o)
echo "Received $replication_count chunk copies"
node_count=$(ls $log_dir | wc -l)
if [ $replication_count -lt $node_count ]; then
Expand Down Expand Up @@ -193,10 +198,11 @@ jobs:
shell: bash
continue-on-error: true
run: |
find ~/.safe/heapnode -iname '*.log*' | tar -zcvf heap_node_log_files.tar.gz --files-from -
find ~/.safe/node/local-test-network -iname '*.log*' | tar -zcvf nodes_log_files.tar.gz --files-from -
find /tmp/safe-client -iname '*.log*' | tar -zcvf client_log_files.tar.gz --files-from -
find . -iname '*log_files.tar.gz' | tar -zcvf log_files.tar.gz --files-from -
if: failure()
if: always()


- name: Upload Heaptrack
Expand All @@ -212,6 +218,6 @@ jobs:
with:
name: sn_node_logs_memcheck
path: log_files.tar.gz
if: failure()
if: always()
continue-on-error: true

0 comments on commit ed7e5a9

Please sign in to comment.