How to measure Windows Azure bandwidth usage programmatically?
I'm running a Windows Azure web application (ASP.Net MVC).
Ho开发者_JAVA技巧w do I measure the bandwidth used by it from within the code?
I have more than one user for the same web app and I would like to limit how much each user is allowed to consume in terms of bandwidth.
So, it is possible to use performance counters to store the network traffic size. However, it sounds like you want to capture custom traffic bandwidth size. If its by user, you'll likely want to create custom trace or other code that takes username of the current user into account
The Azure SDK doesn't provide any billing or consumption information programatically. As lgorek stated, you can approximate usage with IIS And WCF performance counters.And you'll also be able to use your own logging to track traffic from different users. However, you won't be able to track bandwidth consumed when users download content from blob storage. Well, you could, but only if all of your blobs were private and you streamed their content through your web application instead of direct links on your web pages .
精彩评论