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.
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.