From cf48a214eaf62cfceaec544695e351d283feca91 Mon Sep 17 00:00:00 2001 From: David Garvey Date: Wed, 14 Aug 2024 16:30:41 +0200 Subject: [PATCH] calc elapsed time for up script --- up.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/up.sh b/up.sh index f19a5c6e..0c234ea2 100755 --- a/up.sh +++ b/up.sh @@ -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 @@ -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"