Arun Rana
Arun Rana

Reputation: 8606

How to enable and get Perfromance counters for Window Azure

I have developed one web application for monitoring azure application (Webrole) by console(EXE) application attaching in startup task with azure application and that EXE will send data periodically for cpu usage, memory and asp.net total session, however i have done it using WMI Query as per below.

CPU Usage

 ManagementObjectCollection queryCollection = ExecuteWMIQuery("SELECT * FROM Win32_Processor");

Memory

 queryCollection = ExecuteWMIQuery("SELECT * FROM Win32_OperatingSystem");

asp.net Session

queryCollection = ExecuteWMIQuery("Select SessionsActive from Win32_PerfRawData_ASPNET_ASPNETApplications");

But when i testing it with window Azure then i am getting error in event log like below

Disabled performance counter data collection from the "ASP.NET_64_2.0.50727" service because the performance counter library for that service has generated one or more errors. The errors that forced this action have been written to the application event log. Correct the errors before enabling the performance counters for this service


Windows cannot open the 64-bit extensible counter DLL ASP.NET_64_2.0.50727 in a 32-bit environment. Contact the file vendor to obtain a 32-bit version. Alternatively if you are running a 64-bit native environment, you can open the 64-bit extensible counter DLL by using the 64-bit version of Performance Monitor. To use this tool, open the Windows folder, open the System32 folder, and then start Perfmon.exe.

That's why i would like to change my logic with System.Diagnostic class and want to get CPU Usage , available memory and asp.net total session using that class.

I have connect RDP of azure application and run perfmon.exe and see the available performance counter however i found only one counter %processor time, so i need to add another counter.

Can anyone please suggest me that how can i enable it and fetch using C# in my EXE application (will be in startup task)?

Your replays can be really helpful me to achieve my goal

Thanks in Advance!
Arun.

.

Upvotes: 2

Views: 1465

Answers (2)

Jeremy McGee
Jeremy McGee

Reputation: 25200

It sounds like your application has been built as a 32-bit application. Try rebuilding with the configuration manager set to "Any CPU", then redeploying.

Also, check to see if you received any warnings on deployment about 32-bit DLLs.

Upvotes: 2

hermiod
hermiod

Reputation: 1168

Michael washam has some really good posts on using the azure powershell cmdlets for azure diagnostics and performance. IMHO powershell is the best way to go with azure.

Michael's blog. http://michaelwasham.com/

Upvotes: 0

Related Questions