0

I am trying to collect some performance counters from a worker role and WADPerformanceCountersTable is never created.

public override bool OnStart()
{
    // Set the maximum number of concurrent connections 
    ServicePointManager.DefaultConnectionLimit = 12;

    DiagnosticMonitorConfiguration diagConfig = DiagnosticMonitor.GetDefaultInitialConfiguration();

    var procTimeConfig = new PerformanceCounterConfiguration();
    procTimeConfig.CounterSpecifier = @"\Processor(_Total)\% Processor Time";
    procTimeConfig.SampleRate = TimeSpan.FromSeconds(10);

    diagConfig.PerformanceCounters.DataSources.Add(procTimeConfig);
    diagConfig.PerformanceCounters.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);

    DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", diagConfig);

    return base.OnStart();
}

I have tried different log tables like WADLogsTable and WADDiagnosticInfrastructureLogsTable and both are created correctly.

Tonatio
  • 4,026
  • 35
  • 24

2 Answers2

0

This code works fine in my application. Since your ScheduledTransferPeriod is 1 minute are you letting your role run for at least 1 minute? That's when the table will be created.

Rick Rainey
  • 11,096
  • 4
  • 30
  • 48
  • Yes, I have waited for more than a minute. I am starting to think that this is a bug caused by the regional settings, my system is not in English. – Tonatio Mar 31 '13 at 19:53
0

Definitely, this problem is caused by the language of the system. It is explained here:

Error in Azure Emulator when creating Performance Counters

My Windows is the Spanish version, so the name of the performance counters must be in Spanish:

procTimeConfig.CounterSpecifier = @"\Procesador(_Total)\% de tiempo de procesador";

Be careful, this only works locally, not on the cloud.

Community
  • 1
  • 1
Tonatio
  • 4,026
  • 35
  • 24