-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstress_test.sh
More file actions
executable file
·44 lines (36 loc) · 1.27 KB
/
Copy pathstress_test.sh
File metadata and controls
executable file
·44 lines (36 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
API_URL="http://localhost:3000/tasks"
# A list of realistic-sounding agentic tasks
TASKS=(
"Synthesize Q3 Earnings Report"
"Scrape HackerNews Frontpage"
"Train Model: Epoch 4/10"
"Process Webhook Payload"
"Generate API Documentation"
"Run DB Integrity Check"
"Analyze User Retention Cohort"
"Backtest Trading Algorithm"
"Transcribe Meeting Audio"
"Deploy Security Patch"
)
echo "🚀 Initiating Tapestry Stress Test..."
echo "Ensure your index.html dashboard is open and visible!"
echo "Firing 50 concurrent tasks in 3, 2, 1..."
sleep 3
# Fire 50 tasks into the orchestrator
for i in {1..50}; do
# Pick a random task from our list
RANDOM_TASK=${TASKS[$RANDOM % ${#TASKS[@]}]}
PAYLOAD="$RANDOM_TASK (Job #$i)"
# The '&' at the end runs the curl command in the background
# This allows us to fire all 50 almost instantly
curl -s -X POST $API_URL \
-H "Content-Type: application/json" \
-d "{\"payload\": \"$PAYLOAD\"}" > /dev/null &
# A tiny 50-millisecond delay so it looks beautiful on the dashboard UI
sleep 0.05
done
# Wait for all background curl requests to finish sending
wait
echo "✅ All 50 tasks pushed to the queue!"
echo "Check your dashboard to watch the fleet process them."