From a12fb1987524f6ffa0f4496c09a655addc8e676c Mon Sep 17 00:00:00 2001 From: arthurgousset <46296830+arthurgousset@users.noreply.github.com> Date: Tue, 21 May 2024 15:26:24 +0100 Subject: [PATCH] chore(protocol/migrations_sol): adds time tracking To measure how long it takes to run the entire script from start to finish. --- .../create_and_migrate_anvil_devchain.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/protocol/migrations_sol/create_and_migrate_anvil_devchain.sh b/packages/protocol/migrations_sol/create_and_migrate_anvil_devchain.sh index fbbda837206..1bddb79a2b8 100755 --- a/packages/protocol/migrations_sol/create_and_migrate_anvil_devchain.sh +++ b/packages/protocol/migrations_sol/create_and_migrate_anvil_devchain.sh @@ -1,8 +1,11 @@ #!/usr/bin/env bash set -euo pipefail +# Keeping track of start time to measure how long it takes to run the script entirely +START_TIME=$SECONDS + # Compile everything -forge build +time forge build export ANVIL_PORT=8546 @@ -70,4 +73,8 @@ echo "Compiling with libraries... " time forge build $LIBRARIES # run migrations -time forge script migrations_sol/Migration.s.sol --tc Migration --rpc-url http://127.0.0.1:$ANVIL_PORT -vvv $BROADCAST --non-interactive --sender $FROM_ACCOUNT --unlocked $LIBRARIES || echo "Migration script failed" \ No newline at end of file +time forge script migrations_sol/Migration.s.sol --tc Migration --rpc-url http://127.0.0.1:$ANVIL_PORT -vvv $BROADCAST --non-interactive --sender $FROM_ACCOUNT --unlocked $LIBRARIES || echo "Migration script failed" + +# Keeping track of the finish time to measure how long it takes to run the script entirely +ELAPSED_TIME=$(($SECONDS - $START_TIME)) +echo "Total elapsed time: $ELAPSED_TIME seconds" \ No newline at end of file