简体   繁体   English

通过Java SDK的Azure VM指标

[英]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.

相关问题 从Java SDK获取Azure VM的价格 - Get Azure VM price from Java SDK Azure 使用 Java SDK 为 VM 分配角色 - Azure assign role to VM with Java SDK 在 Java SDK 不工作的可用区域中部署 Azure VM - Deploying Azure VM in Avilability Zone with Java SDK not working 使用Azure Storage SDK for Java将VM页面blob从一个Azure订阅复制到另一个Azure订阅 - Use Azure Storage SDK for Java to copy VM page blob from one Azure subscription to another Azure Application Insights 在使用 Java 8 和应用程序洞察力 SDK 1.0.8 版时不显示实时指标 - Azure Application Insights doesn't show live metrics when using Java 8 and application insights SDK version 1.0.8 如何使用Java SDK查询最近五分钟的Azure存储指标 - How to Query Azure Storage metrics for last five minutes using Java SDK 在资源管理器模式下通过Java SDK进行Azure身份验证 - Azure Authenticating via java sdk in Resource manager mode 天蓝色免费试用版帐户无法通过Java SDK进行身份验证 - azure free trial account not able to authenticate via java sdk 如何通过Rest api或Java SDK停止Azure VM以来的时间 - How to get the time since when my Azure VM is stopped through Rest api or Java sdk 如何从Azure ARM Java SDk获得启动和停止VM的响应? - How can I get response for start and stop VM from Azure ARM java SDk?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM