【问题标题】:Error in Azure Emulator when creating Performance Counters创建性能计数器时 Azure 模拟器出错
【发布时间】:2012-11-13 22:11:04
【问题描述】:

我正在尝试测量我的 Azure 项目上的处理器负载,并且在运行模拟器时,我在模拟器控制台中遇到如下错误:

[MonAgentHost] Error: MA EVENT: 2012-10-10T12:15:06.982Z
[MonAgentHost] Error:    2
[MonAgentHost] Error:    9028
[MonAgentHost] Error:    8168
[MonAgentHost] Error:    SysCounterListener.dll
[MonAgentHost] Error:    0
[MonAgentHost] Error:    b9eb57e3-62d5-49a5-b395-abc3bd5
[MonAgentHost] Error:    liscounter.cpp
[MonAgentHost] Error:    SystemCounter::AddCounter
[MonAgentHost] Error:    660
[MonAgentHost] Error:    ffffffffc0000bb9
[MonAgentHost] Error:    0
[MonAgentHost] Error:    
[MonAgentHost] Error:    PdhAddCounter(\Processor(_Total)\% Processor Time) failed

我尝试创建一个新的简单控制台项目(不是 Azure)。在这里,我可以读取性能指标,因此这个建议 http://www.infosysblogs.com/microsoft/2011/06/mystery_of_the_windows_azure_d.html 似乎不是解决方案。

我在 RoleEntryPoint 的 OnStart 中设置性能计数器,如下所示:

public class WebRole : RoleEntryPoint
{
    public override bool OnStart()
    {
        try
        {
            DiagnosticMonitorConfiguration config = DiagnosticMonitor.GetDefaultInitialConfiguration();

            var counters = new List<string>
                    {
                        @"\Processor(_Total)\% Processor Time"
                    };

            if (counters.Count() > 0)
            {
                config.PerformanceCounters.ScheduledTransferPeriod = TimeSpan.FromMinutes(5);
                config.PerformanceCounters.BufferQuotaInMB = 10;

                counters.ForEach(counter =>
                    config.PerformanceCounters.DataSources.Add(
                        new PerformanceCounterConfiguration()
                        {
                            CounterSpecifier = counter,
                            SampleRate = TimeSpan.FromSeconds(10)
                        })
                );
            }

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

        }
        catch (Exception e)
        {
            Trace.TraceError("Exception during WebRole1.OnStart: " + e.ToString());
        }

        return base.OnStart();
    }
}

我已尝试设置 IIS 日志记录,效果很好。追踪也是如此。只是不是性能计数器...

我使用的是安装了 Visual Studio 2010 SP1 和 Azure SDK 1.7 的 Windows 7 Home Premium(它不适用于 SDK 1.3 八)。

有人知道我的安装中缺少什么吗?

【问题讨论】:

    标签: azure azure-compute-emulator


    【解决方案1】:

    您是否偶然使用了非英语版本的 Windows?如果是这样,我有坏消息要告诉你。

    显然,性能计数器已在注册表中本地化,但 Azure 诊断尝试使用其英文名称注册它们(请参阅 PdhAddCounter(\Processor(_Total)\% Processor Time) failed)。

    我遇到了同样的问题,并在 Azure 论坛 (here) 上提出了问题,但没有提供解决方案或解决方法。我想云中的所有服务器都运行英文版的Windows,所以那里没有问题,但你不能在本地测试。

    如果这适用于您,我能提供的唯一解决方案是安装英文版的 Windows。

    【讨论】:

    • 感谢您的回复。你是对的,Windows 版本在有问题的机器上不是英文的。我想知道是否有一些地方我可以将这些键翻译回英文 - 在注册表中可能......嗯......无论如何!感谢您为我解决这个问题。
    • 这意味着没有人在非英语环境中测试过 azure 模拟器!
    猜你喜欢
    • 2017-07-31
    • 1970-01-01
    • 1970-01-01
    • 2017-02-12
    • 2011-01-05
    • 1970-01-01
    • 2013-04-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多