Last active
September 22, 2019 13:31
-
-
Save miticojo/5feb93b5b19a69e53f3de6da886636ab to your computer and use it in GitHub Desktop.
Revisions
-
miticojo revised this gist
Sep 22, 2019 . 1 changed file with 14 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ #!/bin/bash APIURL=https://speech.googleapis.com REMOTEIP=$(curl -s ipinfo.io/ip) REMOTEASN=$(curl -s ipinfo.io/org | cut -d' ' -f1) RESULTFILE="google-ping-api-results-$(date +%s).csv" ## Script start time START=$(date +%s) @@ -10,13 +13,18 @@ ## Total running time UPTIME=$(($(date +%s) - $START)) echo "==========================================" echo "Starting 24h connection test to $APIURL..." echo "Results are written into $RESULTFILE" echo "==========================================" sleep 2 ( echo "timestamp,remote_ip,remote_asn,time_namelookup,time_connect,time_appconnect,time_pretransfer,time_redirect,time_starttransfer,time_total" while [[ $UPTIME -le $DURRATION ]]; do curl -s -o /dev/null \ -w "%{time_namelookup},%{time_connect},%{time_appconnect},%{time_pretransfer},%{time_redirect},%{time_starttransfer},%{time_total}\n" \ $APIURL | xargs -L 1 echo "$(date +'%s'),$REMOTEIP,$REMOTEASN,$1" ## Sleep for a bit sleep 2 @@ -25,3 +33,6 @@ UPTIME=$(($(date +%s) - $START)) done ) | tee $RESULTFILE echo "==========================================" echo "Connection test completed with success. Please send back the results file $RESULTFILE for analisys." -
miticojo revised this gist
Sep 21, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ UPTIME=$(($(date +%s) - $START)) echo "timestamp,time_namelookup,time_connect,time_appconnect,time_pretransfer,time_redirect,time_starttransfer,time_total" while [[ $UPTIME -le $DURRATION ]]; do curl -s -o /dev/null \ -w "%{time_namelookup},%{time_connect},%{time_appconnect},%{time_pretransfer},%{time_redirect},%{time_starttransfer},%{time_total}\n" \ -
miticojo revised this gist
Sep 21, 2019 . 1 changed file with 21 additions and 20 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,26 +1,27 @@ #!/bin/bash APIURL=https://speech.googleapis.com ## Script start time START=$(date +%s) ## Total run time DURRATION=$((60 * 60 * 24)) ## Total running time UPTIME=$(($(date +%s) - $START)) echo "timestamp,time_namelookup,time_connect,time_appconnect,time_pretransfer,time_redirect,time_starttransfer,time_total" while [[ $UPTIME < $DURRATION ]]; do curl -s -o /dev/null \ -w "%{time_namelookup},%{time_connect},%{time_appconnect},%{time_pretransfer},%{time_redirect},%{time_starttransfer},%{time_total}\n" \ $APIURL | xargs -L 1 echo "$(date +'%s'),$1" ## Sleep for a bit sleep 2 ## Update running time UPTIME=$(($(date +%s) - $START)) done -
miticojo created this gist
Sep 20, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ #!/bin/bash APIURL=https://speech.googleapis.com ## Script start time START=$(date +%s) ## Total run time DURRATION=$((60 * 60 * 24)) ## Total running time UPTIME=$(($(date +%s) - $START)) while [[ $UPTIME < $DURRATION ]]; do curl -s -o /dev/null \ -w "%{time_namelookup},%{time_connect},%{time_appconnect},%{time_pretransfer},%{time_redirect},%{time_starttransfer},%{time_total}\n" \ $APIURL | xargs -L 1 echo "$(date +'%s'),$1" ## Sleep for a bit sleep 2 ## Update running time UPTIME=$(($(date +%s) - $START)) done