i'm looking for any tips on improving the performance of get-naperfdata.
i'm writing a script that basically pulls every counter from our systems, formats the data correctly, and then sends it all to graphite.
right now, it takes between 10 to 30 seconds just to do:
function getcounterdata
{
$objects = get-naperfobject
$returnvalue = foreach($obj in $objects)
{
$data = get-naperfdata -name $obj -ea silentlycontinue
foreach($datum in $data)
{
[pscustomobject]@{
"object" = $obj
"counters" = $datum.counters
"name" = $datum.name
"timestamp" = $datum.timestamp
"timestampdt" = $datum.timestampdt
}
}
}
return $returnvalue
}
any ideas?
thanks