是否可以通过某些 API 从 Web 应用程序访问 CPU、RAM 和 ASP.NET 请求性能计数器? 当我使用 System.Diagnostics.PerformanceCounter.NextValue 方法调用它时,出现异常:
Access to the registry key 'Global' is denied.
我看过有关 Web 角色的示例,但没有看到有关网站的示例。
最佳答案
根据this Microsoft Article Azure 网站不支持它:
Windows Performance counter collection isn’t supported on an Azure WebSite
但是,您可以使用旧管理门户中的“监视”选项卡或使用新门户直接在网站“ Blade ”上监视 CPU 使用情况和内存工作集。也许您可以使用Microsoft.WindowsAzure.Management.WebSites以编程方式获取这些数据。
关于c# - 在 Microsoft Azure Web 应用程序中以编程方式访问性能计数器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29632001/