#!/bin/bash # # Example: time /bin/bash ./ramp.sh # # Every 5 minutes (300 seconds) we'll increase the number of concurrent users by 50 # So after 75 minutes we'll reach our final iteration # Which will then run for 30mins and will push through 300 concurrent requests a second over that period # So on the last iteration we'll hit the service 540,000 times over the last 30 minutes period (300*1800) rates=(50 100 150 200 250 300) durations=(300s 600s 900s 1200s 1500s 1800s) url="https://routing.mozart.test.api.bbci.co.uk/news/topics/2611f753-ece7-47ea-9782-f912bc1e4088/film" for i in $(seq 0 5); do echo "GET $url" | ./vegeta attack -rate="${rates[$i]}" -duration="${durations[$i]}" -insecure > "results-${i}.bin" done # Main result printf "\n\nCombined results:\n\n" ./vegeta report -inputs="$(echo results-*.bin | tr ' ' ',')" # Individual results printf "\n\nIndividual results:\n\n" for i in $(seq 0 5); do cat "results-${i}.bin" | ./vegeta report printf "\n\n" done # Cleanup for i in $(seq 0 5); do rm "results-${i}.bin" done