Quantcast
Viewing all articles
Browse latest Browse all 249166

Re: Cpu data gathering script - need help optimizing it.

You can avoid the CSV file by using the Out-DataTable and the Write-DataTable functions.

That also avoids having to use the LogParser utility.

 

Something like this should do the trick.

 

$dt=$alldata|Out-DataTable
Write-DataTable
-ServerInstance"localhost"-Database"CPUStats"-TableName"CPUusage"-Data$dt

 

Note that this will not append the data in the CPUusage table.

A possible solution is to read the data back from SQL before collecting the new metric values.


Viewing all articles
Browse latest Browse all 249166

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>