Microsoft Virtualization Discussions

INVOKE-NASYSSTAT Latency values 0.00.00

dlmaldonado
5,513 Views

Trying to capture the output of invoke-nasysstat and export to csv file and I'm finding that all the latency values report as 0:00:00; which is not the case when I'm looking at the "live" output. Any ideas?

 

 

RdLatWrLatTotLat
0:00:000:00:000:00:00
0:00:000:00:000:00:00
0:00:000:00:000:00:00
1 ACCEPTED SOLUTION

dlmaldonado
5,457 Views

Nevermind. Figured it out.

View solution in original post

4 REPLIES 4

dlmaldonado
5,458 Views

Nevermind. Figured it out.

James_Castro
5,010 Views

What was the solution?

dlmaldonado
5,001 Views

I was rounding the latency values as a number instead of treating it as a time value.

 

Here's something I used to timestamp each count:

 

$sample = Invoke-NaSysstat -Count 1 | Select-Object -Property @{Name = 'Time';E = {(Get-Date -Format s)}}, CPU, CIFS, RdOps, WrOps, TotOps, NetRcvd, NetSent, DiskRd, DiskWr, RdLat, WrLat,
Totlat

 

That'll produce something like this for $sample:

 

Time : 2015-10-20T22:29:18
CPU : 14.430506260567344222793527850
CIFS : 10331
RdOps : 3.9333333333333333333333333333
WrOps : 19.866666666666666666666666667
TotOps : 9570.666666666666666666666667
NetRcvd : 2639462.4
NetSent : 6981973.3333333333333333333333
DiskRd : 2114082.1333333333333333333333
DiskWr : 1854122.6666666666666666666667
RdLat : 00:00:00.0011864
WrLat : 00:00:00.0001040
TotLat : 00:00:00.0003713

 

And then you can see the multiple properties that RdLat contains by:      ($sample.RdLat)

 

Which produces:

 

Days : 0
Hours : 0
Minutes : 0
Seconds : 0
Milliseconds : 0
Ticks : 9264
TotalDays : 1.07222222222222E-08
TotalHours : 2.57333333333333E-07
TotalMinutes : 1.544E-05
TotalSeconds : 0.0009264
TotalMilliseconds : 0.9264

 

So to pull out TotalMilliseconds:    ($sample.RdLat).TotalMilliSeconds

 

Gives you:

0.9264

 

Rutul
5,043 Views

Invoke-NaSysstat -Controller $ControllerObj -Count 2 | Select-Object cpu,diskrd,RdLat,WrLat|Export-Csv -Path path -Append -NoTypeInformation -NoClobber

 

I used this command to generate statistics in csv file

Public