3
1

speed_test.sh 880 B

123456789101112131415161718192021222324252627282930313233
  1. RESOURCES='members councils proposals channels categories threads posts blocks events eras'
  2. SLEEP=15
  3. API=/api/v1/
  4. BALANCER=https://api.joystreamstats.live
  5. SERVER1=https://frankfurt.api.joystreamstats.live
  6. SERVER2=https://helsinki.api.joystreamstats.live
  7. CURL_OPTIONS='-s -o NUL -w %{time_total}s'
  8. while [[ 1 ]] ; do
  9. printf "%15s %15s %15s %15s\n" resource balancer frankfurt helsinki
  10. for res in $RESOURCES
  11. do
  12. printf "%15s %15s %15s %15s\n" $res \
  13. `curl $BALANCER$API$res/1 $CURL_OPTIONS` \
  14. `curl $SERVER1$API$res/1 $CURL_OPTIONS` \
  15. `curl $SERVER2$API$res/1 $CURL_OPTIONS`
  16. done
  17. for res in $RESOURCES
  18. do
  19. printf "%15s %15s %15s %15s\n" "$res (1)" \
  20. `curl $BALANCER$API$res/1 $CURL_OPTIONS` \
  21. `curl $SERVER1$API$res/1 $CURL_OPTIONS` \
  22. `curl $SERVER2$API$res/1 $CURL_OPTIONS`
  23. done
  24. printf "%30s" "restarting in $SLEEP"
  25. sleep $SLEEP
  26. printf "\r%30s\n" ""
  27. done