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.
- Note
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.
Use the
oci queue messages get-stats
command to retrieve queue statistics.oci queue messages get-stats --queue-id <queue_OCID>
Include the
channel-id
parameter 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 parameters and values for CLI commands, see the CLI Command Reference.
Use the GetStats operation to get queue statistics. The Messages endpoint is used for GetStats.
The response to a request without a
channelID
parameter 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
channelID
parameter contains two objects: one containing statistics for the channel and one containing the statistics for the channel's dead letter queue.For information about using the API and signing requests, see REST API documentation and Security Credentials. For information about SDKs, see SDKs and the CLI.