Adding a statistic reporting pattern to a single queue, called myqueue
using the REST API and
cURL. This example uses ancestor
references to include entity names:
Example D.1. Enabling statistics for a single queue using the REST API and cURL
curl --user admin --data '{"name" : "qpid.queue.statisticsReportPattern", "value" : "${ancestor:virtualhost:name}/${ancestor:queue:name}: queueDepthMessages=${queueDepthMessages}, queueDepthBytes=${queueDepthBytes:byteunit}"}' https://localhost:8080/api/latest/queue/default/default/myqueue/setContextVariable
Once enabled, an example statistic report output written to the log might look like this:
INFO [virtualhost-default-pool-0] (q.s.Queue)- Statistics: default/myqueue: queueDepthMessages=0, queueDepthBytes=0 B INFO [virtualhost-default-pool-2] (q.s.Queue)- Statistics: default/myqueue: queueDepthMessages=3, queueDepthBytes=345 B INFO [virtualhost-default-pool-2] (q.s.Queue)- Statistics: default/myqueue: queueDepthMessages=3, queueDepthBytes=345 B
Removing a statistic report pattern from the same queue:
Example D.2. Disabling statistics for a single queue using the REST API and cURL
curl --user admin --data '{"name" : "qpid.queue.statisticsReportPattern"}' https://localhost:8080/api/latest/queue/default/default/myqueue/setContextVariable
Adding a statistic reporting pattern to all queues:
Example D.3. Enabling statistics for all queues using the REST API and cURL
curl --user admin --data '{"name" : "qpid.queue.statisticsReportPattern", "value" : "${ancestor:virtualhost:name}/${ancestor:queue:name}: oldestMessageAge=${oldestMessageAge:duration}"}' https://localhost:8080/api/latest/virtualhost/default/default/setContextVariable
Once enabled, an example statistic report for a virtualhost with two queues might look like this:
INFO [virtualhost-default-pool-1] (q.s.Queue)- Statistics: default/myqueue1: oldestMessageAge=PT1M24S INFO [virtualhost-default-pool-1] (q.s.Queue)- Statistics: default/myqueue2: oldestMessageAge=PT0S
Apache Qpid, Messaging built on AMQP; Copyright © 2015 The Apache Software Foundation; Licensed under the Apache License, Version 2.0; Apache Qpid, Qpid, Qpid Proton, Proton, Apache, the Apache feather logo, and the Apache Qpid project logo are trademarks of The Apache Software Foundation; All other marks mentioned may be trademarks or registered trademarks of their respective owners