我已經設置了一個診斷程序.wadcfg,其中包含很多性能計數器(90+)。但是,它沒有反映在wad-control - 容器一滴。我還確保該文件位於BIN文件夾下。如何強制將diagnostics.wadcfg的內容反映在wad-control-container中
我webrole低於的OnStart代碼段():
// Get the diagnostic monitor for the specified role instance.
RoleInstanceDiagnosticManager roleInstanceDiagnosticManager =
new RoleInstanceDiagnosticManager(myStorageAccount,
"28281fc7754b44faa9ccf4911983edf1",
"MyWebRole",
"deployment(1).MyAzureProject.WebRole1.0");
// Get the current diagnostic monitor for the role.
DiagnosticMonitorConfiguration currentConfiguration = roleInstanceDiagnosticManager.GetCurrentConfiguration();
// Use 30 seconds for the performance counter sample rate.
TimeSpan perfSampleRate = TimeSpan.FromSeconds(30.0);
// Add a performance counter for processor time to the current configuration.
currentConfiguration.PerformanceCounters.DataSources.Add(new PerformanceCounterConfiguration()
{
CounterSpecifier = @"\Processor(_Total)\% Processor Time",
SampleRate = perfSampleRate
});
// Apply the modified configuration to the diagnostic monitor for the role instance.
roleInstanceDiagnosticManager.SetCurrentConfiguration(currentConfiguration);
是否有可能的OnStart()邏輯優先,並覆蓋上diagnostics.wadcfg我的內容?
我diagnostics.wadcfg以下文件:
<DiagnosticMonitorConfiguration
xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration"
configurationChangePollInterval="PT1M"
overallQuotaInMB="8192">
<PerformanceCounters bufferQuotaInMB="100" scheduledTransferPeriod="PT1M">
<!-- 1. AZURE_ASP_NET -->
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\Application Restarts" sampleRate="PT30S" />
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\Applications Running" sampleRate="PT30S" />
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\Request Execution Time" sampleRate="PT30S" />
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\Requests Current" sampleRate="PT30S" />
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\Requests Disconnected" sampleRate="PT30S" />
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\Requests Queued" sampleRate="PT30S" />
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\Requests Rejected" sampleRate="PT30S" />
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\Request Wait Time" sampleRate="PT30S" />
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\State Server Sessions Abandoned" sampleRate="PT30S" />
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\State Server Sessions Active" sampleRate="PT30S" />
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\State Server Sessions Timed Out" sampleRate="PT30S" />
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\State Server Sessions Total" sampleRate="PT30S" />
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\Worker Processes Running" sampleRate="PT30S" />
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\Worker Process Restarts" sampleRate="PT30S" />
</PerformanceCounters>
</DiagnosticMonitorConfiguration>
感謝。
感謝邁克,我已經更新了代碼。如果我從wad-control-container刪除xml,並且我的wadcfg文件只包含性能的東西。這是否意味着我的最終配置將只包含性能計數器或其他IIS,Eventlog等。真的有點混淆 – 2013-05-03 14:11:14
我的理解是,wadcfg變成了配置,所以如果它不在那裏,它不會被包含。我沒有測試過,但從聲明中它取代了默認值,我相信會發生什麼。 – MikeWo 2013-05-04 12:15:09
然後我和產品團隊中的某個人進行了覈實,我指出的文檔中指出的優先級沒有改變。他們正在更新文檔以添加更多信息。 – MikeWo 2013-05-04 12:16:03