Skip to content

Commit

Permalink
Update Send-BulkGraphiteMetrics.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
rschitz authored May 31, 2022
1 parent a1322d1 commit 430eb61
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Functions/Send-BulkGraphiteMetrics.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,17 @@ function Send-BulkGraphiteMetrics
}

# Create Send-To-Graphite Metric
[string[]]$metricStrings = @()
$metricStringsArrayList = [System.Collections.ArrayList]@()
foreach ($key in $Metrics.Keys)
{
$metricStrings += $key + " " + $Metrics[$key] + " " + $UnixTime
$metricStringsArrayList.Add($key + " " + $Metrics[$key] + " " + $UnixTime) | Out-Null

Write-Verbose ("Metric Received: " + $metricStrings[-1])
Write-Verbose ("Metric Received: " + $metricStringsArrayList[-1])
}

# Convert arraylist to string array
$metricStrings = $metricStringsArrayList.ToArray([string])

$sendMetricsParams = @{
"CarbonServer" = $CarbonServer
"CarbonServerPort" = $CarbonServerPort
Expand All @@ -93,4 +96,4 @@ function Send-BulkGraphiteMetrics
}

SendMetrics @sendMetricsParams
}
}

0 comments on commit 430eb61

Please sign in to comment.