Edit

Share via


New-AzPerfCounterDataSourceObject

Create an in-memory object for PerfCounterDataSource.

Syntax

Default (Default)

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

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SamplingFrequencyInSecond

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

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Outputs

PerfCounterDataSource