[英]Azure VM Metrics via Java SDK
// get metric definitions for storage account.
for (MetricDefinition metricDefinition : azure.metricDefinitions().listByResource(storageAccount.id())) {
Azure github has this example to get metrics for a storage account. Azure github拥有此示例以获取存储帐户的指标。 I am struggling to find any reference on what should be passed as parameter to
listByResource()
to get VM Metric (for example Network In metric)? 我正在努力寻找有关应作为参数传递给
listByResource()
以获取VM Metric(例如Network In metric)的任何参考? Appreciate any input. 感谢任何输入。
Firstly, if you want to get metrics supported by Azure Monitor, you could use this to query records. 首先,如果要获取Azure Monitor支持的指标,可以使用它查询记录。 You could also find it in the sample code .
您也可以在示例代码中找到它。
MetricCollection metricCollection = metricDefinition.defineQuery()
.startingFrom(recordDateTime.minusDays(7))
.endsBefore(recordDateTime)
.withAggregation("Average")
.withInterval(Period.minutes(5))
.withOdataFilter("apiName eq 'PutBlob' and responseType eq 'Success' and geoType eq 'Primary'")
.execute();
And about the method description, you could refer to this site . 关于方法的描述,您可以参考此站点 。
As for the VM NetWork metric, I suppose it's not supported, in the official doc : Supported metrics with Azure Monitor on Azure Stack , it lists metrics supported by Azure Monitor. 至于VM NetWork指标,我想它不受支持,在官方文档中: Azure Stack上的Azure Monitor支持的指标 ,它列出了Azure Monitor支持的指标。 With Microsoft.Compute/virtualMachines, it only supports the Percentage CPU metric.
对于Microsoft.Compute / virtualMachines,它仅支持百分比CPU指标。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.