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

az load test server-metric

注意

此参考是 Azure CLI(版本 2.41.0 或更高版本)的负载扩展的一部分。 该扩展将在首次运行 az load test server-metric 命令时自动安装。 详细了解扩展。

命令组“负载测试”处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

用于管理服务器指标的命令组。

用于使用添加、列出和删除来管理负载测试服务器指标的命令组。

命令

名称 说明 类型 状态
az load test server-metric add

向测试添加服务器指标。

分机 预览
az load test server-metric list

列出测试的所有服务器指标。

分机 预览
az load test server-metric remove

从测试中删除给定的服务器指标。

扩展 预览

az load test server-metric add

预览

命令组“负载测试服务器指标”处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

向测试添加服务器指标。

az load test server-metric add --aggregation
                               --app-component-id
                               --app-component-type
                               --load-test-resource
                               --metric-id
                               --metric-name
                               --metric-namespace
                               --test-id
                               [--resource-group]

示例

将应用组件的服务器指标添加到测试中。

az load test server-metric add --test-id sample-test-id --load-test-resource sample-alt-resource --resource-group sample-rg --metric-id "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Sample-rg/providers/Microsoft.Compute/virtualMachineScaleSets/Sample-temp-vmss/providers/microsoft.insights/metricdefinitions/Percentage CPU" --metric-name  "Percentage CPU" --metric-namespace microsoft.compute/virtualmachinescalesets --aggregation Average --app-component-type Microsoft.Compute/virtualMachineScaleSets --app-component-id /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-rg/providers/Microsoft.Compute/virtualMachineScaleSets/app-comp-name

必需参数

--aggregation

要应用于指标的聚合。

--app-component-id

应用组件的完全限定资源 ID。 例如,subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}。

--app-component-type

应用组件的资源类型。 请参阅 https://learn.microsoft.com/cli/azure/resource#az-resource-show

--load-test-resource --name -n

负载测试资源的名称或 ARM 资源 ID。

--metric-id
--metric-name

指标的名称。 示例,请求/持续时间。

--metric-namespace

服务器指标的命名空间。 示例,microsoft.insights/components。

--test-id -t

负载测试的测试 ID。

可选参数

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az load test server-metric list

预览

命令组“负载测试服务器指标”处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

列出测试的所有服务器指标。

az load test server-metric list --load-test-resource
                                --test-id
                                [--resource-group]

示例

列出测试的所有服务器指标。

az load test server-metric list --test-id sample-test-id --load-test-resource sample-alt-resource --resource-group sample-rg

必需参数

--load-test-resource --name -n

负载测试资源的名称或 ARM 资源 ID。

--test-id -t

负载测试的测试 ID。

可选参数

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az load test server-metric remove

预览

命令组“负载测试服务器指标”处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

从测试中删除给定的服务器指标。

az load test server-metric remove --load-test-resource
                                  --metric-id
                                  --test-id
                                  [--resource-group]
                                  [--yes]

示例

从测试中删除服务器指标。

az load test server-metric remove --test-id sample-test-id --load-test-resource sample-alt-resource --resource-group sample-rg --metric-id "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Sample-rg/providers/Microsoft.Compute/virtualMachineScaleSets/Sample-temp-vmss/providers/microsoft.insights/metricdefinitions/Percentage CPU" --yes

必需参数

--load-test-resource --name -n

负载测试资源的名称或 ARM 资源 ID。

--metric-id
--test-id -t

负载测试的测试 ID。

可选参数

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--yes -y

不提示确认。

默认值: False
全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。