From e83a74bb1fc68cea3c50eb2949014822f9f745f8 Mon Sep 17 00:00:00 2001 From: raphaesl <raphaesl@stud.ntnu.no> Date: Sat, 25 Mar 2023 17:17:18 +0100 Subject: [PATCH] pushed scaling to live version --- configuration/manager/cron | 2 +- configuration/manager/frontpage_scale.sh | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/configuration/manager/cron b/configuration/manager/cron index b6ead3b..7d5ce22 100644 --- a/configuration/manager/cron +++ b/configuration/manager/cron @@ -6,4 +6,4 @@ 0 8 * * * bash /home/ubuntu/dcsg2003/configuration/manager/backupDatabase.sh * * * * * cp /home/ubuntu/dcsg2003/configuration/manager/.bashrc /home/ubuntu/.bashrc * * * * * cp /home/ubuntu/dcsg2003/configuration/manager/.bashrc /root/.bashrc -* * * * * bash /home/ubuntu/dcsg2003/configuration/manager/frontpage_scale.sh +*/15 * * * * bash /home/ubuntu/dcsg2003/configuration/manager/frontpage_scale.sh diff --git a/configuration/manager/frontpage_scale.sh b/configuration/manager/frontpage_scale.sh index 48da2da..9906d25 100644 --- a/configuration/manager/frontpage_scale.sh +++ b/configuration/manager/frontpage_scale.sh @@ -52,7 +52,6 @@ function scale { # Safety valve is off, we're running the command $SSH_COMMAND $COMMAND discord_log "Scaling to $1 frontpage users." - echo "$1" > /home/ubuntu/logs/frontpage else # Saftey valve is on, we only print what we would do @@ -79,12 +78,6 @@ fi # Get current download times: DOWNLOAD_TIME=$( curl -s -g 'http://admin:admin@192.168.132.61:9090/api/v1/query?query=last_download_time{name="'$COMPANY_NAME'"}' | jq -r '.data.result[].value[1] ') NUMBER_OF_FRONTPAGE_USERS=$( curl -s -g 'http://admin:admin@192.168.132.61:9090/api/v1/query?query=frontpage_count{name="'$COMPANY_NAME'"}' | jq -r '.data.result[].value[1] ') -LOCAL_FRONTPAGE=$(cat /home/ubuntu/logs/frontpage) - -if (( "$NUMBER_OF_FRONTPAGE_USERS" != "$LOCAL_FRONTPAGE" )); then - echo "Frontpage count not aligned with local value." - exit 1 -fi echo "Observed download time: $DOWNLOAD_TIME" -- GitLab