diff --git a/configuration/manager/frontpage_scale.sh b/configuration/manager/frontpage_scale.sh index 3047190b35d317d49e09d6d703a0e105d6de3c1a..0ce29981cb7328029dcb3ca5ee5e206ae0ec26ab 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