-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-load-test.sh
More file actions
executable file
·78 lines (70 loc) · 2.87 KB
/
run-load-test.sh
File metadata and controls
executable file
·78 lines (70 loc) · 2.87 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
# Convenience script to run NLB load tests
# Colors
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
echo -e "${BLUE}🧪 AWS NLB Load Testing Suite${NC}"
echo "============================="
echo ""
echo "Available test options:"
echo " 1. Quick test (5 threads, 30 seconds)"
echo " 2. Standard test (10 threads, 5 minutes)"
echo " 3. Heavy test (20 threads, 5 minutes)"
echo " 4. Delay test (5 threads, 5 minutes, with 70s delays)"
echo " 5. Custom test (specify parameters)"
echo " 6. Shell-based quick test (30 seconds)"
echo ""
read -p "Select test type (1-6): " choice
case $choice in
1)
echo -e "${YELLOW}Running quick test...${NC}"
java --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED \
-cp "target/classes:$(mvn dependency:build-classpath -Dmdep.outputFile=/dev/stdout -q)" \
org.example.NLBLoadTester --threads 5 --duration 30
;;
2)
echo -e "${YELLOW}Running standard test...${NC}"
java --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED \
-cp "target/classes:$(mvn dependency:build-classpath -Dmdep.outputFile=/dev/stdout -q)" \
org.example.NLBLoadTester --threads 10 --duration 300
;;
3)
echo -e "${YELLOW}Running heavy test...${NC}"
java --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED \
-cp "target/classes:$(mvn dependency:build-classpath -Dmdep.outputFile=/dev/stdout -q)" \
org.example.NLBLoadTester --threads 20 --duration 300
;;
4)
echo -e "${YELLOW}Running delay test...${NC}"
echo "⚠️ This test uses 70-second delays per request"
java --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED \
-cp "target/classes:$(mvn dependency:build-classpath -Dmdep.outputFile=/dev/stdout -q)" \
org.example.NLBLoadTester --threads 5 --duration 300 --delay
;;
5)
echo "Custom test configuration:"
read -p "Number of threads: " threads
read -p "Duration (seconds): " duration
read -p "Use delay mode? (y/N): " use_delay
delay_arg=""
if [[ $use_delay =~ ^[Yy]$ ]]; then
delay_arg="--delay"
fi
echo -e "${YELLOW}Running custom test...${NC}"
java --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED \
-cp "target/classes:$(mvn dependency:build-classpath -Dmdep.outputFile=/dev/stdout -q)" \
org.example.NLBLoadTester --threads $threads --duration $duration $delay_arg
;;
6)
echo -e "${YELLOW}Running shell-based quick test...${NC}"
./test-nlb-quick.sh
;;
*)
echo "Invalid choice. Exiting."
exit 1
;;
esac
echo ""
echo -e "${GREEN}✅ Test completed!${NC}"