Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP API: GET /api/queues/{vhost}/{name} now supports enable_queue_totals (backport #10839) #10844

Merged
merged 1 commit into from Mar 25, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Mar 25, 2024

Proposed Changes

Attempt at issue #10314.

For /api/queues, users can specify disable_stats=true and enable_queue_totals=true parameters to return a concise set of fields. However, the enable_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

  1. Run broker with changes
    bazel run broker RABBITMQ_NODENAME=rmq1@localhost RABBITMQ_ENABLED_PLUGINS='rabbitmq_management,rabbitmq_prometheus'

  2. Perform some load on a queue with perf-test tool

  3. GET http://guest:guest@localhost:15672/api/queues/%2F/test-queue?disable_stats=true

{
	"arguments": {},
	"auto_delete": false,
	"durable": true,
	"exclusive": false,
	"name": "test-queue",
	"node": "rmq1@localhost",
	"state": "running",
	"type": "classic",
	"vhost": "/"
}
  1. GET http://guest:guest@localhost:15672/api/queues/%2F/test-queue?disable_stats=true&enable_queue_totals=true
{
	"arguments": {},
	"auto_delete": false,
	"durable": true,
	"exclusive": false,
	"messages": 175,
	"messages_ready": 175,
	"messages_unacknowledged": 0,
	"name": "test-queue",
	"node": "rmq1@localhost",
	"online": null,
	"state": "running",
	"type": "classic",
	"vhost": "/"
}

Types of Changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes issue #NNNN)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause an observable behavior change in existing systems)
  • Documentation improvements (corrections, new content, etc)
  • Cosmetic change (whitespace, formatting, etc)
  • Build system and/or CI

Checklist

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.

  • I have read the CONTRIBUTING.md document
  • I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq)
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally with my changes
  • If relevant, I have added necessary documentation to https://github.com/rabbitmq/rabbitmq-website
  • If relevant, I have added this change to the first version(s) in release-notes that I expect to introduce it

Further Comments

Not super familiar Erlang best practices, please critique as needed :)


This is an automatic backport of pull request #10839 done by [Mergify](https://mergify.com).

For `/api/queues`, users can specify `disable_stats=true` and
`enable_queue_totals=true` parameters to return a concise set of
fields. However, the `enable_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.

(cherry picked from commit 09d1ec1)
@michaelklishin michaelklishin merged commit 2a3bde7 into v3.13.x Mar 25, 2024
19 checks passed
@michaelklishin michaelklishin deleted the mergify/bp/v3.13.x/pr-10839 branch March 25, 2024 15:24
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.

None yet

2 participants