I am trying to measure processor load on my Azure project and when running the emulator I get errors in the Emulator console like this one:
[MonAgentHost] Error: MA EVENT: 2012-10-10T12:15:06.982Z
[MonAgentHost] Error: 2
[MonAgentHost] Error: 9028
[MonAgentHost] Error: 8168
[MonAgentHost] Error: SysCounterListener.dll
[MonAgentHost] Error: 0
[MonAgentHost] Error: b9eb57e3-62d5-49a5-b395-abc3bd5
[MonAgentHost] Error: liscounter.cpp
[MonAgentHost] Error: SystemCounter::AddCounter
[MonAgentHost] Error: 660
[MonAgentHost] Error: ffffffffc0000bb9
[MonAgentHost] Error: 0
[MonAgentHost] Error:
[MonAgentHost] Error: PdhAddCounter(\Processor(_Total)\% Processor Time) failed
I have tried creating a new simple console project (not Azure). Here I am able to read the performance metrics so this suggestion http://www.infosysblogs.com/microsoft/2011/06/mystery_of_the_windows_azure_d.html doesn't seem to be the solution.
I setup the performance counters in OnStart of the RoleEntryPoint like so:
public class WebRole : RoleEntryPoint
{
public override bool OnStart()
{
try
{
DiagnosticMonitorConfiguration config = DiagnosticMonitor.GetDefaultInitialConfiguration();
var counters = new List<string>
{
@"\Processor(_Total)\% Processor Time"
};
if (counters.Count() > 0)
{
config.PerformanceCounters.ScheduledTransferPeriod = TimeSpan.FromMinutes(5);
config.PerformanceCounters.BufferQuotaInMB = 10;
counters.ForEach(counter =>
config.PerformanceCounters.DataSources.Add(
new PerformanceCounterConfiguration()
{
CounterSpecifier = counter,
SampleRate = TimeSpan.FromSeconds(10)
})
);
}
DiagnosticMonitor.Start(
"Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString",
config);
}
catch (Exception e)
{
Trace.TraceError("Exception during WebRole1.OnStart: " + e.ToString());
}
return base.OnStart();
}
}
I have tried setting up IIS-logging which works just fine. So does tracing. Just not performance counters...
I am on Windows 7 Home Premium with Visual Studio 2010 SP1 and Azure SDK 1.7 installed (it didn't work on SDK 1.3 eighter).
Anyone know what I am missing in my installation?