Getting Queue Statistics
Retrieve statistics about a queue, including its channels and dead letter queue.
You can use these values to scale up or down the number of consumers. Statistical data includes:
- Visible messages: The approximate number of messages currently in a queue that are available for consumption.
- In-flight messages: The approximate number of messages delivered to a consumer but not yet deleted. In-flight messages are unavailable for redelivery until their visibility timeout has passed.
- Approximate size of the queue in bytes as the sum of the size of visible and in-flight messages.
Statistical data is approximate because messages in a queue are constantly published, consumed, and deleted. Shortly after all producers and consumers have been stopped, the values become consistent.
The number of in-flight messages can only be seen using the CLI or API.
- Open the navigation menu and click Developer Services. Under Application Integration, click Queues.
- On the left side of the screen, click Queues.
- In the list of existing queues, click the name of a queue to display its details page.
The Visible messages and Visible messages in DLQ values are displayed.
- (Optional) Click Channels to display statistics for the queue's channels.
- Click Metrics.
The Metrics page displays a default set of charts for the current queue, including Total bytes in the queue. For more information, see Queue Metrics.
oci queue messages get-statscommand to retrieve queue statistics.
oci queue messages get-stats --queue-id <queue_OCID>
channel-idparameter to get statistics about a particular channel.
oci queue messages get-stats --queue-id <queue_OCID> --channel-id <channel_id>
For a complete list of flags and variable options for CLI commands, see
The response to a request without a
channelIDparameter contains two objects: one containing statistics for the queue and one containing the statistics for its dead letter queue.
The response to a request with a
channelIDparameter contains two objects: one containing statistics for the channel and one containing the statistics for the channel's dead letter queue.