创建性能计数器时出错的Azure模拟器 [英] Error in Azure Emulator when creating Performance Counters

查看:215
本文介绍了创建性能计数器时出错的Azure模拟器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图来衡量我的Azure项目处理器负载和运行仿真器,我得到的时候在这样一个仿真器控制台错误:

I am trying to measure processor load on my Azure project and when running the emulator I get errors in the Emulator console like this one:

[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

我曾尝试创建一个新的简单的控制台项目(不天青)。在这里,我能够读取性能指标使这个建议 HTTP://www.infosysblogs .COM /微软/ 2011/06 / mystery_of_the_windows_azure_d.html 似乎并没有成为解决方案。

I have tried creating a new simple console project (not Azure). Here I am able to read the performance metrics so this suggestion http://www.infosysblogs.com/microsoft/2011/06/mystery_of_the_windows_azure_d.html doesn't seem to be the solution.

我安装在RoleEntryPoint中的OnStart像这样的性能计数器:

I setup the performance counters in OnStart of the RoleEntryPoint like so:

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日志记录其中工程就好了。所以做跟踪。只是没有性能计数器...

I have tried setting up IIS-logging which works just fine. So does tracing. Just not performance counters...

我在Windows 7家庭$ P $与Visual Studio 2010 SP1和安装的Azure SDK 1.7 pmium(它没有在SDK 1.3 eighter工作)。

I am on Windows 7 Home Premium with Visual Studio 2010 SP1 and Azure SDK 1.7 installed (it didn't work on SDK 1.3 eighter).

任何人都知道我在安装我丢失?

Anyone know what I am missing in my installation?

推荐答案

您使用Windows的非英语版本的机会呢?如果是这样,我对你的坏消息。

Are you by chance using a non-English version of Windows? If so, I have bad news for you.

显然,性能计数器定位于注册表中,但Azure诊断尝试使用其英文名称(见 PdhAddCounter(\\处理器(_Total)\\%处理器时间)未能注册它们)。

Apparently, performance counters are localized in the registry, but Azure Diagnostics tries to register them using their english names (see PdhAddCounter(\Processor(_Total)\% Processor Time) failed).

我有同样的问题,问一个问题,关于Az​​ure的论坛(<一个href=\"http://social.msdn.microsoft.com/Forums/en-US/windowsazuretroubleshooting/thread/57c24738-53bd-40da-9819-bb217d0baa72/#16ec43b6-27b3-4f13-921b-01997279d9e4\"相对=nofollow>这里),但没有解决方案或替代方法提供了依据。我想在云中的所有服务器运行Windows的英语版本,所以它不是一个问题,但你不能在本地测试。

I had the same problem and asked a question on the Azure forums (here), but no solution or workaround was provided. I suppose all servers in the cloud run an english version of Windows, so it's not an issue there, but you can't test locally.

如果这适用于你,我可以提供唯一的解决办法是安装Windows的英语版本。

If this applies to you, the only solution I can offer is to install an english version of Windows.

这篇关于创建性能计数器时出错的Azure模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆