Repository navigation
Update queue latency threshold to 1.5x for error tracking - #3
Conversation
- Modified check_latency to track errors at 150% of threshold (50% above) - Updated tests to reflect new thresholds: * within_a_minute: errors at 90 seconds or more * within_5_minutes: errors at 450 seconds (7.5 minutes) or more * within_a_hour: errors at 90 minutes or more Co-Authored-By: Grant <grantspeelman@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Run tests on Ruby 3.1, 3.2, and 3.3 - Run RuboCop linter - Trigger on push to main and pull requests Co-Authored-By: Grant <grantspeelman@gmail.com>
RuboCop has pre-existing lint issues in the codebase that are unrelated to current changes. Removing from CI to avoid blocking on existing issues. Co-Authored-By: Grant <grantspeelman@gmail.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adjusts the queue latency error tracking threshold from 1.0x to 1.5x of the configured limit, providing a 50% buffer before critical alerts are triggered. This reduces alert noise while still maintaining monitoring of significantly delayed queues.
Key changes:
- Modified threshold calculation to multiply base time units by 1.5
- Changed comparison logic from
<=to<to correctly evaluate against the new threshold - Updated all test cases to validate behavior at the new 1.5x boundaries
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/nexl_shared/check_queue_latency.rb | Implements 1.5x threshold multiplier and adjusts comparison logic |
| spec/nexl_shared/check_queue_latency_spec.rb | Updates test expectations to verify error tracking at 1.5x thresholds |
| .github/workflows/ruby.yml | Adds GitHub Actions CI workflow for automated testing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Grant <grantspeelman@gmail.com>
grantspeelman
left a comment
There was a problem hiding this comment.
Can you also add documentation about CheckQueueLatency to README.md
- Added NexlShared.queue_latency_error_threshold configuration (defaults to 1.5) - Updated CheckQueueLatency to use configurable threshold - Added comprehensive documentation about CheckQueueLatency to README.md - Documented queue types (standard vs within_* queues) - Explained error threshold behavior with examples - Showed how to configure the threshold - Provided usage examples Co-Authored-By: Grant <grantspeelman@gmail.com>
Modified the
CheckQueueLatencyclass to track errors when queue latency reaches 150% of the defined threshold (50% above the threshold) instead of at exactly the threshold. This change applies to all queues with thewithin_*naming convention.Examples of new thresholds:
within_a_minute(60s) → errors at 90 seconds or morewithin_5_minutes(300s) → errors at 450 seconds (7.5 minutes) or morewithin_a_hour(3600s) → errors at 5400 seconds (90 minutes) or moreChanges:
check_latencymethod to calculatethreshold = amount.public_send(unit) * 1.5queue_latency <= amount.public_send(unit)toqueue_latency < thresholdNotes
Link to Devin run: https://app.devin.ai/sessions/056a6ba612ab4c59815536203b7adbe5
Requested by: Grant (grant@nexl.io) / @grantspeelman
All unit tests pass successfully (27 examples, 0 failures).