我可以远程捕获 Azure Web/辅助角色的性能计数器吗?

发布于 2024-10-31 07:25:34 字数 250 浏览 5 评论 0原文

我知道Azure中的webrole和worker-role中性能计数器和诊断的生成。

  • 我的问题是,给定订阅 ID 和其他证书(提供性能计数器的第三方应用程序),我能否在远程位置或远程应用程序上获取性能计数器。

换句话说,问题是,我能否获取性能计数器数据,即我对任何托管服务使用服务管理 API 的方式...?

需要在服务器中完成哪些预配置...?才能获取CPU数据...???

I am aware of the generation of the Performance Counters and Diagnosis in webrole and worker-role in Azure.

  • My question is can I get the Performance Counter on a remote place or remote app, given the subscription ID and other certificates (3rd Party app to give performance Counter).

Question in other words, Can I get the Performance Counter Data, the way I use Service Management API for any hosted service...?

What are the pre-configurations required to be done in Server...? to get CPU data...???

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

挽手叙旧 2024-11-07 07:25:34

以下是性能计数器表的属性说明:

EventTickCount:存储记录日志条目时的滴答计数(以 UTC 为单位)。

DeploymentId:您的部署的 ID。

Role:角色名称

RoleInstance:角色实例名称

CounterName:计数器名称

CounterValue:性能计数器的值

这里的关键之一是了解如何有效地查询该表(以及其他诊断表)。我们希望从诊断表中获取的内容之一是获取特定时间段的数据。我们的本能反应是根据时间戳属性查询该表。然而,这是一个糟糕的设计选择,因为您知道在 Azure 表中数据是在 PartitionKey 和 RowKey 上建立索引的。对任何其他属性的查询将导致全表扫描,当表包含大量数据时,这会产生问题。

这些日志表的好处是 PartitionKey 值在某种程度上代表了收集数据点的日期/时间。基本上 PartitionKey 是通过使用 DateTime.Ticks(UTC 格式)的高阶位创建的。因此,如果您要获取特定日期/时间范围的数据,首先您需要计算您的范围的刻度(以 UTC 为单位),然后在其前面添加“0”并在查询中使用这些值。

如果您使用 REST API 进行查询,则可以使用如下语法:

PartitionKey ge '0'和 PartitionKey '0'

如果您在我们的工具 Cloud Storage Studio、Visual Studio 或 Azure Storage Explorer 中查询表存储,则可以使用此语法。

不幸的是,我对存储客户端库没有太多经验,但让我解决一些问题。也许我会写一篇关于它的博客文章。一旦我这样做了,我将在这里发布我的博客文章的链接。

高拉夫

Following is the description of the attributes for Performance counters table:

EventTickCount: Stores the tick count (in UTC) when the log entry was recorded.

DeploymentId: Id of your deployment.

Role: Role name

RoleInstance: Role instance name

CounterName: Name of the counter

CounterValue: Value of the performance counter

One of the key thing here is to understand how to effectively query this table (and other diagnostics table). One of the things we would want from the diagnostics table is to fetch the data for a certain period of time. Our natural instinct would be to query this table on Timestamp attribute. However that's a BAD DESIGN choice because you know in an Azure table the data is indexed on PartitionKey and RowKey. Querying on any other attribute will result in full table scan which will create a problem when your table contains a lot of data.

The good thing about these logs table is that PartitionKey value in a way represents the date/time when the data point was collected. Basically PartitionKey is created by using higher order bits of DateTime.Ticks (in UTC). So if you were to fetch the data for a certain date/time range, first you would need to calculate the Ticks for your range (in UTC) and then prepend a "0" in front of it and use those values in your query.

If you're querying using REST API, you would use syntax like:

PartitionKey ge '0<from date/time ticks in UTC>' and PartitionKey le '0<to date/time in UTC>'.

You could use this syntax if you're querying table storage in our tool Cloud Storage Studio, Visual Studio or Azure Storage Explorer.

Unfortunately I don't have much experience with the Storage Client library but let me work something out. May be I will write a blog post about it. Once I do that, I will post the link to my blog post here.

Gaurav

撞了怀 2024-11-07 07:25:34

由于性能计数器数据保留在 Windows Azure 表存储 (WADPerformanceCountersTable) 中,因此您可以通过远程应用程序查询该表(通过使用 Microsoft 的存储客户端库或围绕 Azure 表服务 REST API 编写您自己的自定义包装器来检索数据。您所需要的只是存储帐户名称和密钥。

Since the performance counters data gets persisted in Windows Azure Table Storage (WADPerformanceCountersTable), you can query that table through a remote app (either by using Microsoft's Storage Client library or writing your own custom wrapper around Azure Table Service REST API to retrieve the data. All you will need is the storage account name and key.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文