views:

25

answers:

2

Hi,

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

A: 

Since you're getting counters in Dev Fabric but not in Azure Fabric, let me ask the obvious: Did you change your DiagnosticsConnectionString setting to reference your Azure Storage connection string?

David Makogon
Yes I have done all that. Actually I am able to get in my WADLogs table (Trace logs from by cloud app) in my azure storage, but not in my WADPerformanceCountersTable
Kapil
A: 

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

Kapil