fix: make get_pending_request_counts count processing and claimed too#836
Merged
jamesdborin merged 4 commits intomainfrom Mar 11, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the admin queue monitoring endpoint (get_pending_request_counts) so its “queue depth” calculation counts requests across more in-flight states, not just those strictly in pending.
Changes:
- Expand the
statesfilter passed toget_pending_request_counts_by_model_and_completion_windowto includeclaimedandprocessing. - Add an inline note explaining why these additional states are included.
| .map(|window| (window.clone(), parse_window_to_seconds(window))) | ||
| .collect::<Vec<_>>(); | ||
| let states = vec!["pending".to_string()]; | ||
| let states = vec!["pending".to_string(), "claimed".to_string(), "processing".to_string()]; // Include claimed and processing to get a more complete picture of queue depth |
There was a problem hiding this comment.
There are existing tests for this endpoint, but none validate the state filtering/counting logic. Since this change expands the counted states, please add an integration test that inserts requests in "pending", "claimed", and "processing" (and at least one terminal state) and asserts the endpoint includes only the intended states in its totals.
Deploying control-layer with
|
| Latest commit: |
5d63525
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b8362aca.control-layer.pages.dev |
| Branch Preview URL: | https://fix-queue-count-include-clai.control-layer.pages.dev |
…into fix-queue-count-include-claimed-processing
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Mar 11, 2026
🤖 I have created a release *beep* *boop* --- ## [8.18.0](v8.17.1...v8.18.0) (2026-03-11) ### Features * allow email reuse in orgs with updated unique indx on user emails ([#853](#853)) ([f4ca358](f4ca358)) * migration to allow org members to have the same api key name ([#857](#857)) ([09b6001](09b6001)) * use last_login column to detect first login and redirect onboarding ([#835](#835)) ([45f5138](45f5138)) ### Bug Fixes * make get_pending_request_counts count processing and claimed too ([#836](#836)) ([ae6fbda](ae6fbda)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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.
This pull request expands the queue depth calculation in the
get_pending_request_countsAPI handler to provide a more comprehensive view of the queue status. Previously, only requests in the "pending" state were counted; now, requests in the "claimed" and "processing" states are also included.Queue depth calculation improvements:
dwctl/src/api/handlers/queue.rs: Thestatesvector inget_pending_request_countswas updated to include "claimed" and "processing" states, in addition to "pending", to give a more complete picture of queue depth.