David Dury
David Dury

Reputation: 5717

Azure Storage Count Transactions

Can you please explain what is the best way to estimate the transactions number on windows azure storage using the development environment? I though about implementing an int variable and increment that ex: i++ each time I make a call to azure storage? What do you think? Have you done such thing before? I just need to have an estimated amount of transactions ...

Upvotes: 1

Views: 1215

Answers (2)

David Makogon
David Makogon

Reputation: 71120

@techmike2kx gave you the REST API info. Instead, let me address your other question regarding the use of a local transaction counter. That approach won't really help you at all, for a few reasons:

  • If you have multiple instances of your app running (e.g. 2 web role instances), you'd need a single counter across instances, which means you're now synchronizing, or you're accumulating numbers somewhere. And... you'll probably store these instance-specific counters in something like table storage, which will result in additional transactions.
  • What if you use an attached disk with your VM? There will be transactions generated since the vhd is stored in a blob. You'll have no visibility into those transactions.
  • Your storage account could be used by multiple apps. How will you track that?
  • Your storage account could be used for logging and diagnostics, which you don't have much control over, regarding how those calls are made.
  • You'll need to track unsuccessful transactions since these are not billed (these are documented).
  • Some calls make multiple storage transactions. For instance: If you query table storage, and exceed what can be returned in a single transaction, you'll end up with multiple calls to storage, under the hood (hidden by the language-specific SDK you're using).
  • What happens when you serve web content directly from blobs (e.g. http://mysite.blob.core.windows.net/images/logo.jpg)? You'd have no control over this access, so no way to track it
  • when will you roll your counter back to zero? How will you know the exact month-end of your billing cycle?

I'm sure there are other gotchas, but the bottom line is: You shouldn't be trying to track transaction consumption, since it's given to you via storage analytics.

Upvotes: 1

techmike2kx
techmike2kx

Reputation: 495

there's the Windows Azure Storage Services REST API which you can use, it contains a a full API stack for Storage Analytics: http://msdn.microsoft.com/en-us/library/windowsazure/hh343270.aspx. hope this helps (of course you can use the native monitoring through the portal also for starters)

Upvotes: 2

Related Questions