共用方式為


az load test server-metric

注意

此參考是 Azure CLI 的載入 延伸模組的一部分 (2.41.0 版或更高版本)。 擴充功能會在您第一次執行 az load test server-metric 命令時自動安裝。 深入了解擴充功能。

命令群組 「負載測試」處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

管理伺服器計量的命令群組。

使用新增、列出和移除來管理負載測試伺服器計量的命令群組。

命令

名稱 Description 類型 狀態
az load test server-metric add

將伺服器計量新增至測試。

擴充 預覽版
az load test server-metric list

列出測試的所有伺服器計量。

擴充 預覽版
az load test server-metric remove

從測試中移除指定的伺服器計量。

擴充 預覽版

az load test server-metric add

預覽

命令群組 'load test server-metric' 處於預覽狀態,且正在開發中。 參考和支援層級: 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

應用程式元件的完整資源識別碼。 例如,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 資源識別碼。

--metric-id
--metric-name

計量的名稱。 範例:要求/持續時間。

--metric-namespace

伺服器計量的命名空間。 範例 microsoft.insights/components。

--test-id -t

負載測試的測試識別碼。

選擇性參數

--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

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az load test server-metric list

預覽

命令群組 'load test server-metric' 處於預覽狀態,且正在開發中。 參考和支援層級: 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 資源識別碼。

--test-id -t

負載測試的測試識別碼。

選擇性參數

--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

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az load test server-metric remove

預覽

命令群組 'load test server-metric' 處於預覽狀態,且正在開發中。 參考和支援層級: 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 資源識別碼。

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

負載測試的測試識別碼。

選擇性參數

--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

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。