Created
September 16, 2022 16:37
-
-
Save Tiduster/6daa02b673197003e4f3a48bbbfc0d1d to your computer and use it in GitHub Desktop.
Latency Test AWS
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
#!/bin/bash | |
if [ "$EUID" -ne 0 ] | |
then echo "Please run as root" | |
exit | |
fi | |
REGION_ARRAY=('us-east-1' 'eu-west-1' 'af-south-1' 'ap-southeast-1' 'ap-southeast-2' 'ap-south-1' 'ap-northeast-2') | |
SERVICE_ARRAY=('ecr' 's3' 'dynamodb') | |
PROBE_COUNT=20 | |
for region in "${REGION_ARRAY[@]}"; do | |
for service in "${SERVICE_ARRAY[@]}"; do | |
ping_avg_rtt=$(ping -4 -c $PROBE_COUNT -q ${service}.${region}.amazonaws.com | grep rtt | awk -F '/' '{print $5}') | |
nping_avg_rtt=$(nping -q --tcp -p 443 -c $PROBE_COUNT ${service}.${region}.amazonaws.com | grep rtt | awk -F ' ' '{print $NF}') | |
echo "$region $service $ping_avg_rtt $nping_avg_rtt" | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment