You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TOTAL_RECORDS=10000 # Change to 100000 for the full test
7
+
CONCURRENCY=50 # Number of parallel requests
8
+
TABLE="test_perf"
9
+
10
+
echo"=== Starting Performance Test ($TOTAL_RECORDS records) ==="
11
+
12
+
# 1) Register & Authenticate Alice
13
+
echo"[1/4] Registering and authenticating user..."
14
+
curl -s -X POST "$BASE_URL/auth/alice" \
15
+
-H "Content-Type: application/json" \
16
+
-d '{"secret":"s3cr3t"}'> /dev/null
17
+
18
+
TOKEN=$(curl -s -X POST "$BASE_URL/auth/alice" \
19
+
-H "Content-Type: application/json" \
20
+
-d '{"secret":"s3cr3t"}'| jq -r .token)
21
+
22
+
if [ -z"$TOKEN" ] || [ "$TOKEN"=="null" ];then
23
+
echo"Error: Failed to retrieve JWT token. Is the server running?"
24
+
exit 1
25
+
fi
26
+
27
+
# 50-word Lorem Ipsum JSON payload
28
+
PAYLOAD='{"value": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident."}'
29
+
30
+
# 2) Parallel PUT Operations (Data Storage Test)
31
+
echo"[2/4] Inserting $TOTAL_RECORDS records with $CONCURRENCY concurrent workers..."
32
+
START_TIME=$(date +%s)
33
+
34
+
# We use seq and xargs to blast the server with concurrent requests
0 commit comments