New-LMPushMetricDataPoint
Syntax
New-LMPushMetricDataPoint [[-DataPointsArray] <System.Collections.Generic.List`1[System.Object]>] [-DataPoints] <System.Collections.Generic.List`1[System.Object]> [[-DataPointType] <String>] [[-DataPointAggregationType] <String>] [[-PercentileValue] <Int32>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Description
The New-LMPushMetricDataPoint function creates a new data point object that can be used to push metric data to LogicMonitor. The function accepts an array of data points, where each data point consists of a name and a value. The function also allows you to specify the data point type, aggregation type, and percentile value.
Examples
Example 1
$datapoints = @( [PSCustomObject]@{ Name = "CPUUsage" Value = 80 }, [PSCustomObject]@{ Name = "MemoryUsage" Value = 60 })
New-LMPushMetricDataPoint -DataPoints $datapoints -DataPointType “gauge” -DataPointAggregationType “avg”
This example creates two data points for CPU usage and memory usage, and sets the data point type to “gauge” and the aggregation type to “avg”.
Parameters
-DataPointsArray
An optional parameter that allows you to pass an existing array of data points. If not provided, a new array will be created.
Type: System.Collections.Generic.List`1[System.Object]Parameter Sets: (All)Aliases:
Required: FalsePosition: 1Default value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-DataPoints
A mandatory parameter that accepts an array of data points. Each data point should be an object with a Name and a Value property.
Type: System.Collections.Generic.List`1[System.Object]Parameter Sets: (All)Aliases:
Required: TruePosition: 2Default value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-DataPointType
Specifies the type of the data point. Valid values are “counter”, “derive”, and “gauge”. The default value is “gauge”.
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: 3Default value: GaugeAccept pipeline input: FalseAccept wildcard characters: False
-DataPointAggregationType
Specifies the aggregation type of the data point. Valid values are “min”, “max”, “avg”, “sum”, “none”, and “percentile”. The default value is “none”.
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: 4Default value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-PercentileValue
Specifies the percentile value for the data point. This parameter is only applicable when the DataPointAggregationType is set to “percentile”. The value should be between 0 and 100.
Type: Int32Parameter Sets: (All)Aliases:
Required: FalsePosition: 5Default value: 0Accept pipeline input: FalseAccept wildcard characters: False
-ProgressAction
Fill ProgressAction Description
Type: ActionPreferenceParameter Sets: (All)Aliases: proga
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
None. You cannot pipe objects to this command.
Outputs
Returns LogicMonitor.DataPoint object.
Notes
You must run Connect-LMAccount before running this command.