Skip to content

Commit da6df0a

Browse files
committed
test
1 parent 9d55e66 commit da6df0a

File tree

1 file changed

+9
-5
lines changed
  • terraform/python/ec2/adot-genai

1 file changed

+9
-5
lines changed

terraform/python/ec2/adot-genai/main.tf

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,24 +126,28 @@ done
126126
# Create traffic generator script
127127
cat > /app/generate_traffic.sh << 'TRAFFIC_EOF'
128128
#!/bin/bash
129-
DELAY_SECONDS="$${DELAY_SECONDS:-60}"
129+
DELAY_SECONDS="$${DELAY_SECONDS:-10}"
130130
NUM_REQUESTS="$${NUM_REQUESTS:-5}"
131131
TIMEOUT="$${TIMEOUT:-30}"
132132
MESSAGES=("What is the weather like today?" "Tell me a joke" "How do I make a cup of coffee?" "What are the benefits of exercise?" "Explain quantum computing in simple terms")
133133
134+
echo "Starting traffic generator with $$NUM_REQUESTS requests, $$DELAY_SECONDS second delay"
135+
date
136+
134137
for i in $$(seq 1 $$NUM_REQUESTS); do
135138
message="$${MESSAGES[$$((RANDOM % $${#MESSAGES[@]}))]}"
136-
echo "Request $$i: $$message"
137-
curl -X POST http://localhost:8000/ai-chat -H "Content-Type: application/json" -d "{\"message\": \"$$message\"}" -m $$TIMEOUT
139+
echo "[$(date)] Request $$i: $$message"
140+
curl -v -X POST http://localhost:8000/ai-chat -H "Content-Type: application/json" -d "{\"message\": \"$$message\"}" -m $$TIMEOUT
141+
echo "Request $$i completed"
138142
aws s3 cp /var/log/langchain-service.log s3://appsignals-genai-test/logs/${var.test_id}/langchain-service-request-$$i.log
139143
sleep $$DELAY_SECONDS
140144
done
145+
146+
echo "Traffic generator completed"
141147
TRAFFIC_EOF
142148
143149
chmod +x /app/generate_traffic.sh
144150
145-
146-
147151
# Start traffic generator in background
148152
echo "Starting traffic generator..."
149153
nohup /app/generate_traffic.sh > /var/log/traffic-generator.log 2>&1 &

0 commit comments

Comments
 (0)