Reputation: 13
I am using Microsoft Azure and I am trying to find out how much memory my queues have used. I can correctly create an account, get the queue, and fetch the attributes, but I am unsure of the syntax to get how much memory I've used. Here's my code:
Upvotes: 0
Views: 163
Reputation: 1751
Like Igorek and Michael Roberson have already pointed out, realistically you can get an approximate maximum size only (which will still vary wildly from the actual size).
You haven't said why you want to find this information out, normally the number of items in the queue is more relevant. Only you know what process / action is performed on this data. Sometimes they hold all the information you need, but more often than not they just contain a token that references a larger set of data.
Some queues spawn long running process and others short, so you have to tailor other metrics (VM scaling for example or whatever you're trying to find out) around this.
Upvotes: 0
Reputation: 1621
The size of each message in a queue is currently not available without dequeueing the messages. You could estimate the size by multiplying the ApproximateMessageCount by the average size of a message. Each message can be at most 64KB in size, so an upper bound on the space a queue is using is ApproximateMessageCount * 64KB.
Upvotes: 2