Skip to content

Commit

Permalink
calc elapsed time for up script
Browse files Browse the repository at this point in the history
  • Loading branch information
davegarvey committed Aug 14, 2024
1 parent 22fa085 commit cf48a21
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

source scripts/common.sh

up_start_time=$(date +%s)

# persistence of log files is disabled by default, meaning the files are recreated between each bootstrap to prevent them from growing too large
# to enable persistence, use argument "persist-log" when running this script
persist_log=false
Expand Down Expand Up @@ -165,6 +167,16 @@ for deployment in "${deployments_to_create[@]}"; do
fi
done

up_end_time=$(date +%s)
up_elapsed_time=$((up_end_time - up_start_time))
up_minutes=$((up_elapsed_time / 60))
up_seconds=$((up_elapsed_time % 60))
if [ $up_minutes -gt 0 ]; then
log_message "Elapsed time: $up_minutes minutes $up_seconds seconds"
else
log_message "Elapsed time: $up_seconds seconds"
fi

# Confirm initialisation process is complete
printf "\nTyk Demo initialisation process completed"
printf "\n-----------------------------------------\n\n"

0 comments on commit cf48a21

Please sign in to comment.