File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
src/content/changelog/queues Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -20,14 +20,14 @@ The following endpoints also now include a `metadata.metrics` object on the resu
2020
2121### Javascript APIs
2222
23- Both ` env.QUEUE.send () ` and ` env.QUEUE.sendBatch() ` now return a ` metrics ` object, or you can use ` env.QUEUE.metrics() ` directly :
23+ Call ` env.QUEUE.metrics () ` to get realtime backlog metrics:
2424
2525``` ts
26- const {
27- backlogCount : number,
28- backlogBytes : number,
29- oldestMessageTimestamp : Date | undefined,
30- } = await env . QUEUE . metrics ( ... )
31- ```
26+ const metrics = await env . QUEUE . metrics ();
27+ metrics . backlogCount ; // number
28+ metrics . backlogBytes ; // number
29+ metrics . oldestMessageTimestamp ; // number (milliseconds since epoch)
30+
31+ ` env.QUEUE.send() ` and ` env.QUEUE.sendBatch() ` also now return a metrics object on the response .
3232
3333You can also query these fields via the [GraphQL Analytics API ](/ analytics / graphql - api / ). For more information , refer to [Metrics ](/ queues / observability / metrics / ).
You can’t perform that action at this time.
0 commit comments