From a0538fbe227f1331f4f9724d2f51e171d5e00c3a Mon Sep 17 00:00:00 2001 From: raphaesl <raphaesl@stud.ntnu.no> Date: Sat, 25 Mar 2023 16:46:48 +0100 Subject: [PATCH] Adjusted frontpage_scale for personal use --- configuration/manager/frontpage_scale.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/configuration/manager/frontpage_scale.sh b/configuration/manager/frontpage_scale.sh index 3047190..0ce2998 100644 --- a/configuration/manager/frontpage_scale.sh +++ b/configuration/manager/frontpage_scale.sh @@ -77,8 +77,8 @@ fi # The site is up, so we can proceed with checking its performance # 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] ') - discord_log "Observed download time: $DOWNLOAD_TIME" +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] ') +discord_log "Observed download time: $DOWNLOAD_TIME" # check if we are below the lower threshold. If we are, we scale up if (( $(echo "$DOWNLOAD_TIME < $DOWNLOAD_TIME_LOWER_THRESHOLD" | bc -l) )); then @@ -105,5 +105,4 @@ elif (( $(echo "$DOWNLOAD_TIME > $DOWNLOAD_TIME_UPPER_THRESHOLD" | bc -l) )); th discord_log "Scaling down to $NEW_FRONTPAGE_COUNT as new frontpage_limit" scale $NEW_FRONTPAGE_COUNT fi - fi \ No newline at end of file -- GitLab