Problem/Motivation
When debugging a queue, sometimes its difficult, especially for some transports, to inspect the overall size of a queue. Especially for non SQL-like, or if CLI tools for the transport backend in question are not available.
Determining the size of the queue is also useful for autoscaling workers. For example, https://fly.io/docs/launch/autoscale-by-metric/
And programmatically retrieving the size (as an integer) simply becomes sm messenger:stats asynchronous --format=json | jq '.transports.asynchronous.count // empty' || exit 1
Proposed resolution
Implement the stats command, as provided by Messenger component.
Add basic integration tests.
Remaining tasks
Do it.
User interface changes
Only the `sm` CLI interface.
API changes
New services
Data model changes
None
Issue fork sm-3579442
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
dpiThis is as green as its going to get for now.
Comment #5
dpi