Skip to content

Update queue latency threshold to 1.5x for error tracking - #3

Merged
grantspeelman merged 6 commits into
mainfrom
devin/1761316570-queue-latency-threshold-update
Oct 25, 2025
Merged

grantspeelman merged 6 commits into
mainfrom
devin/1761316570-queue-latency-threshold-update

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 24, 2025 •

Copy link
Copy Markdown
Contributor

Modified the CheckQueueLatency class 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 the within_* naming convention.

Examples of new thresholds:

  • within_a_minute (60s) → errors at 90 seconds or more
  • within_5_minutes (300s) → errors at 450 seconds (7.5 minutes) or more
  • within_a_hour (3600s) → errors at 5400 seconds (90 minutes) or more

Changes:

  • Modified check_latency method to calculate threshold = amount.public_send(unit) * 1.5
  • Changed comparison from queue_latency <= amount.public_send(unit) to queue_latency < threshold
  • Updated all test cases to reflect the new 1.5x threshold behavior

Notes

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).

- 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-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration Bot and others added 3 commits October 24, 2025 14:46
- 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>
@grantspeelman
grantspeelman requested a review from Copilot October 25, 2025 05:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 grantspeelman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add documentation about CheckQueueLatency to README.md

Comment thread lib/nexl_shared/check_queue_latency.rb Outdated
- 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>
@grantspeelman
grantspeelman merged commit 459836d into main Oct 25, 2025
4 checks passed
@grantspeelman
grantspeelman deleted the devin/1761316570-queue-latency-threshold-update branch October 25, 2025 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants