1

VisualStudio2010 とエミュレータ ツールを使用しています (2012 年 6 月)。
新しい仕事の役割プロジェクトを作成します。

WorkerRole.csファイル内:

public class WorkerRole : RoleEntryPoint
{
    public override void Run()
    {
        Trace.TraceInformation("Begin loop at " + DateTime.Now);
        int i = 0;
        while (true)
        {
            Trace.TraceInformation("I'm in a loop (" + i++ + ") at " + DateTime.Now + ".");
            Thread.Sleep(15000);
        }
    }

    private void InitLogs()
    {
        DiagnosticMonitorConfiguration config = DiagnosticMonitor.GetDefaultInitialConfiguration();
        config.Logs.ScheduledTransferLogLevelFilter = LogLevel.Verbose;
        config.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);

        DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", config);
        Trace.TraceInformation("Start at " + DateTime.Now);
    }

    public override bool OnStart()
    {
        ServicePointManager.DefaultConnectionLimit = 12;
        InitLogs();
        return base.OnStart();
    }
}

私の設定では:

Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString = UseDevelopmentStorage=true

app.config:

<system.diagnostics>
    <trace>
        <listeners>
            <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                name="AzureDiagnostics">
                <filter type="" />
            </add>
        </listeners>
    </trace>
</system.diagnostics>

ローカルでデバッグを開始 (F5) すると、Windows Azure コンピューティング エミュレーターで次のように表示されます。

[fabric] Role Instance: deployment16(275).WindowsAzureProject2.WorkerRole1.0
[fabric] Role state Started
[Diagnostics]: UpdateState(Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorStartupInfo, Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorConfiguration, )
[runtime] Role entrypoint . CALLING   OnStart()
[Diagnostics]: Acquired mutex
[Diagnostics] Information: C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor
[Diagnostics] Information: c:\users\benjamin.lux\documents\visual studio 2010\Projects\WindowsAzureProject2\WindowsAzureProject2\csx\Debug\roles\WorkerRole1\diagnostics\x64\monitor\MonAgentHost.exe -LocalPath "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor" -StaticConfigFile "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor\Configuration\mastaticconfig.xml" -ConfigFile "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor\Configuration\maconfig.xml" -ShutDownEvent WADDM-ShutDown-54bc885b045e40ecaf8474c810199ab5 -InitializedEvent WADM-StartUp-54bc885b045e40ecaf8474c810199ab5 -parent 7656 -events
[Diagnostics]: UpdateState(Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorStartupInfo, Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorConfiguration, )
[Diagnostics]: Mutex already taken
[Diagnostics]: Creating config channel client
[Diagnostics]: Attempting to connect to server...
[MonAgentHost] Error: MA EVENT: 2012-07-09T08:17:40.111Z
[MonAgentHost] Error:     2
[MonAgentHost] Error:     6920
[MonAgentHost] Error:     4636
[MonAgentHost] Error:     SelfMonitoring
[MonAgentHost] Error:     0
[MonAgentHost] Error:     x:\btsdx\215\services\monitoring\agent\dll\selfmon.cpp
[MonAgentHost] Error:     MASelfMon::GetProcCntrs
[MonAgentHost] Error:     1421
[MonAgentHost] Error:     ffffffffc0000bb8
[MonAgentHost] Error:     0
[MonAgentHost] Error:     
[MonAgentHost] Error:     PdhAddCounter(\Process(MonAgentHost#0)\ID Process) failed
[Diagnostics]: Creating config channel server
[MonAgentHost] Output: Agent will exit when WADDM-ShutDown-54bc885b045e40ecaf8474c810199ab5 is signaled.
[MonAgentHost] Output: Will signal WADM-StartUp-54bc885b045e40ecaf8474c810199ab5 after the agent is initialized.
[MonAgentHost] Output: Registered as an event consumer.
[MonAgentHost] Output: Agent will exit when parent process 7656 exits.
[MonAgentHost] Output: Monitoring Agent Started
[Diagnostics]: Starting configuration channel polling
[Diagnostics]: Connection sucessful, sending config
[WaWorkerHost.exe] Start at 09/07/2012 10:17:40
[runtime] Role entrypoint . COMPLETED OnStart()
[Diagnostics]: Config request received
[Diagnostics]: Signalling process restart on event = WADDM-ShutDown-54bc885b045e40ecaf8474c810199ab5
[MonAgentHost] Error: MA EVENT: 2012-07-09T08:17:40.662Z
[MonAgentHost] Error:     3
[MonAgentHost] Error:     6920
[MonAgentHost] Error:     4636
[MonAgentHost] Error:     SelfMonitoring
[MonAgentHost] Error:     0
[MonAgentHost] Error:     x:\btsdx\215\services\monitoring\agent\dll\selfmon.cpp
[MonAgentHost] Error:     MASelfMon::StartTerminationCountdown
[MonAgentHost] Error:     1088
[MonAgentHost] Error:     10011
[MonAgentHost] Error:     0
[MonAgentHost] Error:     
[MonAgentHost] Error:     Not starting termination thread inside a client hosted monitoring agent
[MonAgentHost] Output: Exiting the monitoring agent 6920 after the shutdown event was signaled.
[MonAgentHost] Output: Monitoring Agent Stopped
[Diagnostics] Information: Diagnostic process exited with code: 0
[runtime] Role entrypoint . CALLING   Run()
[WaWorkerHost.exe] Begin loop at 09/07/2012 10:17:40
[WaWorkerHost.exe] I'm in a loop (0) at 09/07/2012 10:17:40.
[Diagnostics] Information: C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor
[Diagnostics] Information: c:\users\benjamin.lux\documents\visual studio 2010\Projects\WindowsAzureProject2\WindowsAzureProject2\csx\Debug\roles\WorkerRole1\diagnostics\x64\monitor\MonAgentHost.exe -LocalPath "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor" -StaticConfigFile "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor\Configuration\mastaticconfig.xml" -ConfigFile "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor\Configuration\maconfig.xml" -ShutDownEvent WADDM-ShutDown-5548c4bc522e4f858d6ab6df287747cf -InitializedEvent WADM-StartUp-5548c4bc522e4f858d6ab6df287747cf -parent 7656 -events
[MonAgentHost] Error: MA EVENT: 2012-07-09T08:17:42.930Z
[MonAgentHost] Error:     2
[MonAgentHost] Error:     6260
[MonAgentHost] Error:     5472
[MonAgentHost] Error:     SelfMonitoring
[MonAgentHost] Error:     0
[MonAgentHost] Error:     x:\btsdx\215\services\monitoring\agent\dll\selfmon.cpp
[MonAgentHost] Error:     MASelfMon::GetProcCntrs
[MonAgentHost] Error:     1421
[MonAgentHost] Error:     ffffffffc0000bb8
[MonAgentHost] Error:     0
[MonAgentHost] Error:     
[MonAgentHost] Error:     PdhAddCounter(\Process(MonAgentHost#0)\ID Process) failed
[MonAgentHost] Output: Agent will exit when WADDM-ShutDown-5548c4bc522e4f858d6ab6df287747cf is signaled.
[MonAgentHost] Output: Will signal WADM-StartUp-5548c4bc522e4f858d6ab6df287747cf after the agent is initialized.
[MonAgentHost] Output: Registered as an event consumer.
[MonAgentHost] Output: Agent will exit when parent process 7656 exits.
[MonAgentHost] Output: Monitoring Agent Started
[Diagnostics]: Starting configuration channel polling
[WaWorkerHost.exe] I'm in a loop (1) at 09/07/2012 10:17:55.
[WaWorkerHost.exe] I'm in a loop (2) at 09/07/2012 10:18:10.
[MonAgentHost] Error: MA EVENT: 2012-07-09T08:18:15.202Z
[MonAgentHost] Error:     2
[MonAgentHost] Error:     6260
[MonAgentHost] Error:     5412
[MonAgentHost] Error:     NetTransport
[MonAgentHost] Error:     0
[MonAgentHost] Error:     x:\btsdx\215\services\monitoring\shared\nettransport\src\netutils.cpp
[MonAgentHost] Error:     OpenHttpSession
[MonAgentHost] Error:     749
[MonAgentHost] Error:     0
[MonAgentHost] Error:     2f94
[MonAgentHost] Error:     
[MonAgentHost] Error:     WinHttpGetProxyForUrl(http://127.0.0.1) failed ERROR_WINHTTP_AUTODETECTION_FAILED (12180)
[MonAgentHost] Error: MA EVENT: 2012-07-09T08:18:22.313Z
[MonAgentHost] Error:     2
[MonAgentHost] Error:     6260
[MonAgentHost] Error:     7912
[MonAgentHost] Error:     NetTransport
[MonAgentHost] Error:     0
[MonAgentHost] Error:     x:\btsdx\215\services\monitoring\shared\nettransport\src\netutils.cpp
[MonAgentHost] Error:     OpenHttpSession
[MonAgentHost] Error:     749
[MonAgentHost] Error:     0
[MonAgentHost] Error:     2f94
[MonAgentHost] Error:     
[MonAgentHost] Error:     WinHttpGetProxyForUrl(http://127.0.0.1) failed ERROR_WINHTTP_AUTODETECTION_FAILED (12180)
[MonAgentHost] Error: MA EVENT: 2012-07-09T08:18:24.578Z
[MonAgentHost] Error:     2
[MonAgentHost] Error:     6260
[MonAgentHost] Error:     7912
[MonAgentHost] Error:     NetTransport
[MonAgentHost] Error:     0
[MonAgentHost] Error:     x:\btsdx\215\services\monitoring\shared\nettransport\src\netutils.cpp
[MonAgentHost] Error:     OpenHttpSession
[MonAgentHost] Error:     749
[MonAgentHost] Error:     0
[MonAgentHost] Error:     2f94
[MonAgentHost] Error:     
[MonAgentHost] Error:     WinHttpGetProxyForUrl(http://127.0.0.1) failed ERROR_WINHTTP_AUTODETECTION_FAILED (12180)
[WaWorkerHost.exe] I'm in a loop (3) at 09/07/2012 10:18:25.
[Diagnostics]: Checking for configuration updates 09/07/2012 10:18:40.
[WaWorkerHost.exe] I'm in a loop (4) at 09/07/2012 10:18:40.
[Diagnostics]: Signalling process restart on event = WADDM-ShutDown-5548c4bc522e4f858d6ab6df287747cf
[MonAgentHost] Error: MA EVENT: 2012-07-09T08:18:40.731Z
[MonAgentHost] Error:     3
[MonAgentHost] Error:     6260
[MonAgentHost] Error:     5472
[MonAgentHost] Error:     SelfMonitoring
[MonAgentHost] Error:     0
[MonAgentHost] Error:     x:\btsdx\215\services\monitoring\agent\dll\selfmon.cpp
[MonAgentHost] Error:     MASelfMon::StartTerminationCountdown
[MonAgentHost] Error:     1088
[MonAgentHost] Error:     10011
[MonAgentHost] Error:     0
[MonAgentHost] Error:     
[MonAgentHost] Error:     Not starting termination thread inside a client hosted monitoring agent
[MonAgentHost] Output: Exiting the monitoring agent 6260 after the shutdown event was signaled.
[MonAgentHost] Output: Monitoring Agent Stopped
[Diagnostics] Information: Diagnostic process exited with code: 0
[Diagnostics] Information: C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor
[Diagnostics] Information: c:\users\benjamin.lux\documents\visual studio 2010\Projects\WindowsAzureProject2\WindowsAzureProject2\csx\Debug\roles\WorkerRole1\diagnostics\x64\monitor\MonAgentHost.exe -LocalPath "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor" -StaticConfigFile "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor\Configuration\mastaticconfig.xml" -ConfigFile "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor\Configuration\maconfig.xml" -ShutDownEvent WADDM-ShutDown-88b62f24f2154dbabb56a138a624ff8a -InitializedEvent WADM-StartUp-88b62f24f2154dbabb56a138a624ff8a -parent 7656 -events
[MonAgentHost] Error: MA EVENT: 2012-07-09T08:18:42.920Z
[MonAgentHost] Error:     2
[MonAgentHost] Error:     6068
[MonAgentHost] Error:     7820
[MonAgentHost] Error:     SelfMonitoring
[MonAgentHost] Error:     0
[MonAgentHost] Error:     x:\btsdx\215\services\monitoring\agent\dll\selfmon.cpp
[MonAgentHost] Error:     MASelfMon::GetProcCntrs
[MonAgentHost] Error:     1421
[MonAgentHost] Error:     ffffffffc0000bb8
[MonAgentHost] Error:     0
[MonAgentHost] Error:     
[MonAgentHost] Error:     PdhAddCounter(\Process(MonAgentHost#0)\ID Process) failed
[MonAgentHost] Output: Agent will exit when WADDM-ShutDown-88b62f24f2154dbabb56a138a624ff8a is signaled.
[MonAgentHost] Output: Will signal WADM-StartUp-88b62f24f2154dbabb56a138a624ff8a after the agent is initialized.
[MonAgentHost] Output: Registered as an event consumer.
[MonAgentHost] Output: Agent will exit when parent process 7656 exits.
[MonAgentHost] Output: Monitoring Agent Started
[Diagnostics]: Starting configuration channel polling
[WaWorkerHost.exe] I'm in a loop (5) at 09/07/2012 10:18:55.
[WaWorkerHost.exe] I'm in a loop (6) at 09/07/2012 10:19:10.
[MonAgentHost] Error: MA EVENT: 2012-07-09T08:19:15.198Z
[MonAgentHost] Error:     2
[MonAgentHost] Error:     6068
[MonAgentHost] Error:     612
[MonAgentHost] Error:     NetTransport
[MonAgentHost] Error:     0
[MonAgentHost] Error:     x:\btsdx\215\services\monitoring\shared\nettransport\src\netutils.cpp
[MonAgentHost] Error:     OpenHttpSession
[MonAgentHost] Error:     749
[MonAgentHost] Error:     0
[MonAgentHost] Error:     2f94
[MonAgentHost] Error:     
[MonAgentHost] Error:     WinHttpGetProxyForUrl(http://127.0.0.1) failed ERROR_WINHTTP_AUTODETECTION_FAILED (12180)
[MonAgentHost] Error: MA EVENT: 2012-07-09T08:19:22.313Z
[MonAgentHost] Error:     2
[MonAgentHost] Error:     6068
[MonAgentHost] Error:     7748
[MonAgentHost] Error:     NetTransport
[MonAgentHost] Error:     0
[MonAgentHost] Error:     x:\btsdx\215\services\monitoring\shared\nettransport\src\netutils.cpp
[MonAgentHost] Error:     OpenHttpSession
[MonAgentHost] Error:     749
[MonAgentHost] Error:     0
[MonAgentHost] Error:     2f94
[MonAgentHost] Error:     
[MonAgentHost] Error:     WinHttpGetProxyForUrl(http://127.0.0.1) failed ERROR_WINHTTP_AUTODETECTION_FAILED (12180)
[MonAgentHost] Error: MA EVENT: 2012-07-09T08:19:24.577Z
[MonAgentHost] Error:     2
[MonAgentHost] Error:     6068
[MonAgentHost] Error:     7748
[MonAgentHost] Error:     NetTransport
[MonAgentHost] Error:     0
[MonAgentHost] Error:     x:\btsdx\215\services\monitoring\shared\nettransport\src\netutils.cpp
[MonAgentHost] Error:     OpenHttpSession
[MonAgentHost] Error:     749
[MonAgentHost] Error:     0
[MonAgentHost] Error:     2f94
[MonAgentHost] Error:     
[MonAgentHost] Error:     WinHttpGetProxyForUrl(http://127.0.0.1) failed ERROR_WINHTTP_AUTODETECTION_FAILED (12180)
[WaWorkerHost.exe] I'm in a loop (7) at 09/07/2012 10:19:25.
[WaWorkerHost.exe] I'm in a loop (8) at 09/07/2012 10:19:40.

したがって、トレース メッセージ 0、1、2、3、4、5、6、7、および 8
を確認できます。 いいえ Begin、番号 0 および 5、6、7、および 8

2 つの主な質問: 彼らはどこにいますか?
ロギングの「転送期間」の間にインスタンスを停止するとどうなりますか? この場合、最後のログが保存されているか、DeploymentDiagnosticManagerクラスを使用してアップロードを強制する必要がありますか?

2 番目の質問は、おそらく 4 つの lasts メッセージが問題にならないからです。

Windows Azure コンピューティング エミュレーターの情報エラーは重要ではありません:ブログ投稿

編集 09/07/2012 : 状況を明確にします。

編集16/07/2012 : 誰かが新しいワーカー ロール プロジェクトを作成し、上記のコードを追加できる場合は、F5 キーを押します。それが個人的な取引なのか、エミュレータの問題なのか (またはその他) を知りたいです。

4

1 に答える 1

0

私の経験に基づくと、診断モニターを開始する前に SetCurrentConfiguration を使用する必要があります。そうしないと、トレース ログが WadLogsTable に転送されません。これにより、現在のログ転送時間が使用されてログが移動されます。ログがいつ作成されたかを確認する時間を追加できますか?

于 2012-07-06T17:11:57.023 に答える