New-LMPushMetricDataPoint
Syntax
Section titled “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>] [-WhatIf] [-Confirm] [<CommonParameters>]Description
Section titled “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
Section titled “Examples”Example 1
Section titled “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
Section titled “Parameters”-DataPointsArray
Section titled “-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
Section titled “-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
Section titled “-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
Section titled “-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
Section titled “-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-WhatIf
Section titled “-WhatIf”Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameterParameter Sets: (All)Aliases: wi
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-Confirm
Section titled “-Confirm”Prompts you for confirmation before running the cmdlet.
Type: SwitchParameterParameter Sets: (All)Aliases: cf
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-ProgressAction
Section titled “-ProgressAction”Fill ProgressAction Description
Type: ActionPreferenceParameter Sets: (All)Aliases: proga
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: FalseCommonParameters
Section titled “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
Section titled “Inputs”None. You cannot pipe objects to this command.
Section titled “None. You cannot pipe objects to this command.”Outputs
Section titled “Outputs”Returns LogicMonitor.DataPoint object.
Section titled “Returns LogicMonitor.DataPoint object.”You must run Connect-LMAccount before running this command.