Last active
February 7, 2022 16:15
-
-
Save murder/7216ea27177707562f29915305beb75d to your computer and use it in GitHub Desktop.
simples script pra verificar latencia oracle cloud
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Check latency for cloud endpoints | |
# 2022 - murder | |
regions=(sa-saopaulo-1 sa-vinhedo-1 sa-santiago-1 us-phoenix-1 us-ashburn-1 us-sanjose-1) | |
[[ $1 == "" ]] && tries=10 || tries=$1 | |
retrieve(){ | |
element="$1" | |
url="https://objectstorage.${element}.oraclecloud.com/ping" | |
value="$(curl -w "%{time_total}s" $url -o /dev/null 2>/dev/null)" | |
} | |
printf "%s\t" "${regions[@]}" && printf "\n" | |
for ((i=1; i<=$tries; i++));do | |
for reg in ${regions[@]};do | |
[[ $reg == ${regions[-1]} ]] && suffix="\n" || suffix="\t" | |
retrieve "$reg" | |
printf "${value}${suffix}" | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment