2013-05-13 12:01 PM
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:
$objects = get-naperfobject
$returnvalue = foreach($obj in $objects)
$data = get-naperfdata -name $obj -ea silentlycontinue
foreach($datum in $data)
"object" = $obj
"counters" = $datum.counters
"name" = $datum.name
"timestamp" = $datum.timestamp
"timestampdt" = $datum.timestampdt
2014-06-23 02:16 PM
The way to improve performance is to 1) LIke cknight said said, get only what you need and 2) Break it down in to multiple reads. So minute 0 run 5 objects, minute 1 - 5 more, minute 2 - 5 more and so on. Even ops mgr does not check all counters at same time, it breaks it down in to multiple reads.