你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

MetricsOperations 类

警告

请勿直接实例化此类。

相反,应通过以下方式访问以下操作:

MonitorManagementClient

<xref:metrics> 属性。

继承
builtins.object
MetricsOperations

构造函数

MetricsOperations(*args, **kwargs)

方法

list

列出资源的指标值。

list

列出资源的指标值。

list(resource_uri: str, filter: str | None = None, **kwargs: Any) -> Iterable[Metric]

参数

resource_uri
str
必需

资源的标识符。 必需。

filter
str
必需

减少收集的数据集。:code:
The filter is optional. If present it must contain a list of metric names to retrieve of the form: *(name.value eq 'metricName' [or name.value eq 'metricName' or ...])*. Optionally, the filter can contain conditions for the following attributes *aggregationType*, *startTime*, *endTime*, and *timeGrain* of the form *attributeName operator value*. Where operator is one of *ne*, *eq*, *gt*, *lt*.:code:
Several conditions can be combined with parentheses and logical operators, e.g: *and*, *or*.:code:
Some example filter expressions are::code:
- $filter= (name.value eq 'RunsSucceeded') and aggregationType eq 'Total' and startTime eq 2016-02-20 and endTime eq 2016-02-21 和 timeGrain eq duration 'PT1M',:code:
- $filter= (name.value eq 'RunsSucceeded') and (aggregationType eq 'Total' or aggregationType eq 'Average') and startTime eq 2016-02-20 和 endTime eq 2016-02-21 和 timeGrain eq duration'PT1H',:code:
- $filter= (name.value eq 'ActionsCompleted' or name.value eq 'RunsSucceededed') and (aggregationType eq 'Total' or aggregationType eq 'Average ') 和 startTime eq 2016-02-20 和 endTime eq 2016-02-21 和 timeGrain eq duration'PT1M'.:code:
<br>注意:当指标查询包含多个指标,但未定义聚合类型时,服务将选取第一个指标的主聚合类型,用作所有指标的默认聚合类型。 默认值为 None。

cls
callable

将传递直接响应的自定义类型或函数

返回

一个迭代器,例如指标的实例或 cls 的结果 (响应)

返回类型

例外

属性

models

models = <module 'azure.mgmt.monitor.v2016_09_01.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.7\\x64\\Lib\\site-packages\\azure\\mgmt\\monitor\\v2016_09_01\\models\\__init__.py'>