-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathrun_loadtest.sh
More file actions
executable file
·35 lines (30 loc) · 920 Bytes
/
run_loadtest.sh
File metadata and controls
executable file
·35 lines (30 loc) · 920 Bytes
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
#!/bin/bash
METRICS_HOST="${METRICS_HOST:-localhost}"
METRICS_PORT="${METRICS_PORT:-6770}"
NUM_REQUESTS="${NUM_REQUESTS:-1000}"
CONCURRENCY_LIMIT="${CONCURRENCY_LIMIT:-1}"
ENDPOINT="${ENDPOINT:-/metrics}"
# Construct the target URL
LOAD_TEST_URL="http://${METRICS_HOST}:${METRICS_PORT}${ENDPOINT}"
echo "HotPath Load Test (using oha)"
echo "=============================="
echo ""
echo "Configuration:"
echo " Target URL: ${LOAD_TEST_URL}"
echo " Num Requests: ${NUM_REQUESTS}"
echo " Concurrency: ${CONCURRENCY_LIMIT}"
echo ""
echo "Prerequisites:"
echo " - Make sure the metrics server is running"
echo " - Run an example: cargo run --example long_running --features hotpath"
echo ""
echo "Starting load test..."
echo ""
oha -n "${NUM_REQUESTS}" \
-c "${CONCURRENCY_LIMIT}" \
-m GET \
-H "Accept: application/json" \
"${LOAD_TEST_URL}"
echo ""
echo "Load test completed!"
echo ""