I am trying to capture the following PerformanceCounters on the Azure WebRole:
private string[] perfCounters = { @"\Processor(_Total)\% Processor Time",
@"\ASP.NET Applications(__Total__)\Requests/Sec",
@"\Memory\Available Bytes",
@"\ASP.NET\Request Execution Time",
@"\ASP.NET\Requests Queued"};
I have in my WebRole.cs the following code to enable capturing of these perf counters as this:
DiagnosticMonitorConfiguration config = DiagnosticMonitor.GetDefaultInitialConfiguration();
int loggingInterval = Int32.Parse(RoleEnvironment.GetConfigurationSettingValue("loggingInterval"));
config.Logs.ScheduledTransferPeriod = System.TimeSpan.FromMinutes(loggingInterval);
foreach (String s in perCounters)
{
PerformanceCounterConfiguration procTimeConfig = new PerformanceCounterConfiguration();
procTimeConfig.CounterSpecifier = s;
procTimeConfig.SampleRate = System.TimeSpan.FromMinutes(1.0);
config.PerformanceCounters.DataSources.Add(procTimeConfig);
}
config.PerformanceCounters.ScheduledTransferPeriod = System.TimeSpan.FromMinutes(1.0);
DiagnosticMonitor.Start("DiagnosticsConnectionString", config);
As you see, I am setting the scheduled xfer period of perf counters to 1 min.
Now, I am able to get these counters in the WADPerformanceCounters table on my dev fabric, but I am not able to get them on the azure cloud? Can anyone point out what could I be doing wrong here?
Kapil
The problem supposedly was not at the places I was looking at. The fix for this was pretty simple, I deleted the pre-existing deployment and uploaded my cspkg file as a fresh deployment. It seems that th perf counters are picked up based on an xml file under the wad-control-container blob. This xml file is made for each deployment. I realized that the xml file was not getting updated in my case, and when I deleted the deployment and created a new deployment, it was taking the fresh value.
Thanks
Kapil