Skip to content

Commit

Permalink
Add rate limit script
Browse files Browse the repository at this point in the history
Signed-off-by: Lucas Rodriguez <lucas.rodriguez9616@gmail.com>
  • Loading branch information
lucasrod16 committed Sep 29, 2024
1 parent a777b38 commit 1d53804
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions scripts/rate_limit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -euo pipefail

temp_file=$(mktemp)

# Send 20 concurrent GET requests and store status codes
for _ in {1..20}; do
curl -s -o /dev/null -w "%{http_code}\n" https://osscontribute.com/repos >> "$temp_file" &
done
wait

echo "Summary of HTTP Status Codes:"
sort "$temp_file" | uniq -c | awk '{print "Status Code " $2 ": " $1}'

rm "$temp_file"

0 comments on commit 1d53804

Please sign in to comment.