Editar

Compartir vía


New-AzPerfCounterDataSourceObject

Create an in-memory object for PerfCounterDataSource.

Syntax

New-AzPerfCounterDataSourceObject
   [-CounterSpecifier <String[]>]
   [-Name <String>]
   [-SamplingFrequencyInSecond <Int32>]
   [-Stream <String[]>]
   [<CommonParameters>]

Description

Create an in-memory object for PerfCounterDataSource.

Examples

Example 1: creates a PerfCounterDataSource with Microsoft-InsightsMetrics

New-AzPerfCounterDataSourceObject -CounterSpecifier "\\Processor(_Total)\\% Processor Time" -Name perfCounter01 -SamplingFrequencyInSecond 60 -Stream Microsoft-InsightsMetrics

CounterSpecifier                        Name          SamplingFrequencyInSecond Stream
----------------                        ----          ------------------------- ------
{\\Processor(_Total)\\% Processor Time} perfCounter01                        60 {Microsoft-InsightsMetrics}

This command creates a PerfCounterDataSource with Microsoft-InsightsMetrics.

Example 2: Create a PerfCounterDataSource with Microsoft-Perf

New-AzPerfCounterDataSourceObject -CounterSpecifier "\\Processor(_Total)\\% Processor Time","\\Memory\\Committed Bytes","\\LogicalDisk(_Total)\\Free Megabytes","\\PhysicalDisk(_Total)\\Avg. Disk Queue Length" -Name cloudTeamCoreCounters -SamplingFrequencyInSecond 15 -Stream Microsoft-Perf

CounterSpecifier                                                                                                                                          Name                  SamplingFrequencyInSecond Stream
----------------                                                                                                                                          ----                  ------------------------- ------
{\\Processor(_Total)\\% Processor Time, \\Memory\\Committed Bytes, \\LogicalDisk(_Total)\\Free Megabytes, \\PhysicalDisk(_Total)\\Avg. Disk Queue Length} cloudTeamCoreCounters                        15 {Microsoft-Perf}

This command creates a PerfCounterDataSource with Microsoft-Perf.

Parameters

-CounterSpecifier

A list of specifier names of the performance counters you want to collect. Use a wildcard (*) to collect a counter for all instances. To get a list of performance counters on Windows, run the command 'typeperf'.

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

-Name

A friendly name for the data source. This name should be unique across all data sources (regardless of type) within the data collection rule.

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

-SamplingFrequencyInSecond

The number of seconds between consecutive counter measurements (samples).

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

-Stream

List of streams that this data source will be sent to. A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will be sent to.

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

Outputs

PerfCounterDataSource