HTTP API: GET /api/queues/{vhost}/{name} now supports enable_queue_totals #10839
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.
Proposed Changes
Attempt at issue #10314.
For
/api/queues
, users can specifydisable_stats=true
andenable_queue_totals=true
parameters to return a concise set of fields. However, theenable_queue_totals
is not currently supported for/api/queues/<vhost>/<name>
, probably just a small oversight that "slipped through the cracks".This commit adds that support and updates the respective unit test, focusing on not breaking existing public functions and on simplicity, at the cost of a slight bit of duplication.
Testing
Run broker with changes
bazel run broker RABBITMQ_NODENAME=rmq1@localhost RABBITMQ_ENABLED_PLUGINS='rabbitmq_management,rabbitmq_prometheus'
Perform some load on a queue with perf-test tool
GET
http://guest:guest@localhost:15672/api/queues/%2F/test-queue?disable_stats=true
http://guest:guest@localhost:15672/api/queues/%2F/test-queue?disable_stats=true&enable_queue_totals=true
Types of Changes
What types of changes does your code introduce to this project?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply.You can also fill these out after creating the PR.
If you're unsure about any of them, don't hesitate to ask on the mailing list.
We're here to help!
This is simply a reminder of what we are going to look for before merging your code.
CONTRIBUTING.md
documentFurther Comments
Not super familiar Erlang best practices, please critique as needed :)