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

Invoke-AzIotHubDeploymentMetricsQuery

Invoke an IoT Edge deployment metric query.

Syntax

Invoke-AzIotHubDeploymentMetricsQuery
      [-ResourceGroupName] <String>
      [-IotHubName] <String>
      -Name <String>
      -MetricName <String>
      [-MetricType <PSConfigurationMetricType>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Invoke-AzIotHubDeploymentMetricsQuery
      [-InputObject] <PSIotHub>
      -Name <String>
      -MetricName <String>
      [-MetricType <PSConfigurationMetricType>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Invoke-AzIotHubDeploymentMetricsQuery
      [-ResourceId] <String>
      -Name <String>
      -MetricName <String>
      [-MetricType <PSConfigurationMetricType>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

Evaluate a target custom or system metric defined in an IoT Edge deployment. There are pre-defined system metrics which are calculated by Iot Hub and cannot be customized.

  • "Targeted" shows the IoT Edge devices that match the deployment targeting condition.
  • "Applied" shows the targeted IoT Edge devices that are not targeted by another deployment of higher priority.
  • "Reporting Success" shows the IoT Edge devices that have reported that the modules have been deployed successfully.
  • "Reporting Failure" shows the IoT Edge devices that have reported that one or more modules haven't been deployed successfully. To further investigate the error, connect remotely to those devices and view the log files.

Examples

Example 1

Invoke-AzIotHubDeploymentMetricsQuery -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -Name "myDeploy1" -MetricName "warningLimit"

Evaluate the custom defined 'warningLimit' metric.

Example 2

Invoke-AzIotHubDeploymentMetricsQuery -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -Name "myDeploy1" -MetricName "Reporting Success" -MetricType "system"

Evaluate the system 'Reporting Success' metric.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

IotHub object

Type:PSIotHub
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-IotHubName

Name of the Iot Hub

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-MetricName

Target metric for evaluation.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-MetricType

Indicates which metric collection should be used to lookup a metric.

Type:PSConfigurationMetricType
Accepted values:Custom, System
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Identifier for the deployment.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

Name of the Resource Group

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceId

IotHub Resource Id

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

PSIotHub

String

Outputs

PSConfigurationMetricsResult