Replace hardcoded sleep with polling for CloudWatch Logs Insights queries#20
Merged
llama90 merged 4 commits intofeat/e2e-performance-trackingfrom Jan 4, 2026
Merged
Conversation
…eries Co-authored-by: llama90 <6668548+llama90@users.noreply.github.com>
Co-authored-by: llama90 <6668548+llama90@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update E2E performance tracking based on feedback
Replace hardcoded sleep with polling for CloudWatch Logs Insights queries
Jan 3, 2026
- Fix .metrics.json being selected instead of test results - Fix timestamp conversion from milliseconds to seconds for AWS CLI - Add dynamic CloudWatch period calculation to avoid 1440 datapoint limit - Fix AWS statistics parameter format (space-separated instead of comma) - Add error handling for CloudWatch queries 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
llama90
approved these changes
Jan 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
analyze-performance.shscript used hardcodedsleepvalues (5s, 8s) when waiting for CloudWatch Logs Insights queries, which are insufficient under high load or in high-latency regions.Changes
Polling mechanism: Implemented
wait_for_query_completion()that polls query status until completion, timeout, or failureComplete,Failed,Cancelled,Timeout,Running,ScheduledConfiguration: Added environment variables for tuning
CLOUDWATCH_QUERY_MAX_WAIT(default: 60s) - maximum wait timeCLOUDWATCH_QUERY_POLL_INTERVAL(default: 2s) - polling intervalReplaced: All 7 hardcoded sleep calls with polling function
Example
The polling mechanism returns immediately on query completion rather than waiting fixed delays, making it more efficient for both fast and slow queries.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.