如何使用Storage API获取Azure经典VM指标? [英] How Storage API can be used to get Azure Classic VM metrics?

查看:77
本文介绍了如何使用Storage API获取Azure经典VM指标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们是否可以使用存储API收集Azure Classic VM的指标,或者是否有其他方法可以获取Azure Classic VM的指标,请提出建议.

Can we collect metrics for Azure Classic VM using Storage API or is there any other way to get the metrics for Azure Classic VM please suggest.

推荐答案

要从Azure存储服务获取Azure VM指标,需要启用诊断并在Azure门户上配置存储帐户.

To get the Azure VM metrics from a Azure Storage Service, you need to enable Diagnostics and configure the Storage Account on Azure portal.

之后,您会发现将创建多个表来存储指标.

After that, you will find that multi tables will be created to store the metrics.

这些表具有以下命名约定:

The tables are with the following naming conventions:

  • WADMetrics :所有WADMetrics表的标准前缀
  • PT1H或PT1M :表示该表包含1小时或1分钟以内的汇总数据
  • P10D :表示该表将包含从表开始收集数据起的10天之内的数据
  • V2S :字符串常量
  • yyyymmdd :表格开始收集数据的日期
  • WADMetrics : Standard prefix for all WADMetrics tables
  • PT1H or PT1M : Signifies that the table contains aggregate data over 1 hour or 1 minute
  • P10D : Signifies the table will contain data for 10 days from when the table started collecting data
  • V2S : String constant
  • yyyymmdd : The date at which the table started collecting data

每个WADMetrics表将包含以下列:

Each WADMetrics table will contain the following columns:

  • PartitionKey :分区键是基于resourceID值构造的,用于唯一标识VM资源.例如:-002F订阅:: 002F资源组:002F:002F提供者:002FMicrosoft:002E计算:002F虚拟机:002F
  • RowKey :遵循格式:.递减时间滴答计算是最大时间滴答减去聚合周期开始时间.例如.如果采样周期始于2015年11月10日和UTC时间00:00Hrs,则计算将为:DateTime.MaxValue.Ticks-(new DateTime(2015,11,10,0,0,0,DateTimeKind.Utc).Ticks ).对于内存可用字节性能计数器,行键如下所示:2519551871999999999 __:005CMemory:005CAvailable:0020Bytes
  • CounterName :性能计数器的名称.这与xml配置中定义的counterSpecifier匹配.
  • 最大值:聚集期间性能计数器的最大值.
  • 最小值:聚集期间性能计数器的最小值.
  • 总计:在汇总期间内报告的性能计数器的所有值的总和.
  • Count:为性能计数器报告的值的总数.
  • 平均值:性能计数器在汇总期间的平均值(总计/计数).
  • PartitionKey: The partitionkey is constructed based on the resourceID value to uniquely identify the VM resource. for e.g. : - 002Fsubscriptions::002FresourceGroups:002F:002Fproviders:002FMicrosoft:002ECompute:002FvirtualMachines:002F
  • RowKey : Follows the format :. The descending time tick calculation is max time ticks minus the time of the beginning of the aggregation period. E.g. if the sample period started on 10-Nov-2015 and 00:00Hrs UTC then the calculation would be: DateTime.MaxValue.Ticks - (new DateTime(2015,11,10,0,0,0,DateTimeKind.Utc).Ticks). For the memory available bytes performance counter the row key will look like: 2519551871999999999__:005CMemory:005CAvailable:0020Bytes
  • CounterName : Is the name of the performance counter. This matches the counterSpecifier defined in the xml config.
  • Maximum : The maximum value of the performance counter over the aggregation period.
  • Minimum : The minimum value of the performance counter over the aggregation period.
  • Total : The sum of all values of the performance counter reported over the aggregation period.
  • Count : The total number of values reported for the performance counter.
  • Average : The average (total/count) value of the performance counter over the aggregation period.

要从Azure Table读取数据,可以使用Azure Table客户端库或Azure Table REST API.

To read the data from Azure Table, you could use Azure Table client library or Azure Table REST API.

Azure Table入门.NET存储

表服务REST API

更新2017/07/18

我怀疑20170709是开始日期,20170719是结束日期,对吗?

my doubt is 20170709 is start date and 20170719 is end date am i right?

是的,你是对的.

疑问2.要访问此表,我需要创建一个POJO,以便如何获取表的模式,这意味着如果max/minimum/Average为int/long/double/float

Doubt 2.To access this table i need to create a POJO so how can i get the schema of the table meaning if maximum/minimum/Average is int/long/double/float

您可以从Azure存储资源管理器中打开表的实体.您将看到列的类型.例如,

You can open a entity of the table from Azure Storage Explorer. You will see the type of the columns. For example,

疑问3.如何查询WADMetricsPT1HP10DV2S20170709以获取某一特定小时的指标?

Doubt 3. how to query WADMetricsPT1HP10DV2S20170709 to get metrics for one particular hour?

您可以按时间戳查询数据.

You could query the data by Timestamp.

这篇关于如何使用Storage API获取Azure经典VM指标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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