On 03/17/2016 08:59 AM, Ken McDonell wrote:
...
and on Mac OS X
fuji:archives kenj$ pmiostat -t 1 -a dm-io -xt,h | head -8
Fri Aug 1 14:34:51 2014 sda 0.0 0.0 0.0 0.0 0.0
0.0 0.00 0.00 0.0 0.0 0.0 0.0
Fri Aug 1 14:34:51 2014 sdb 0.0 0.0 5.0 6.0 24.0
8.0 2.91 0.00 0.4 0.4 0.3 0.4
Fri Aug 1 14:34:52 2014 sda 0.0 0.0 0.0 0.0 0.2
0.0 34.00 0.00 9.6 9.6 0.0 0.0
Fri Aug 1 14:34:52 2014 sdb 0.0 0.0 0.3 0.0 12.4
0.0 40.65 0.00 0.9 0.9 0.2 0.0
Fri Aug 1 14:34:53 2014 sda ? ? ? ? ?
? ? ? ? ? ? ?
Fri Aug 1 14:34:53 2014 sdb ? ? ? ? ?
? ? ? ? ? ? ?
\..
pmiostat prints "NODATA" for the instance along with a row of '?' if there is
no data. So we have data.
If we have data, but any one of the columns is negative, i.e. counter went
backwards or timestamp
As part of the rate conversion,
we use the following to get the time delta :
def timeStampDelta(self, group):
c = 1000000.0 * group.timestamp.tv_sec + group.timestamp.tv_usec
p = 1000000.0 * group.prevTimestamp.tv_sec +
group.prevTimestamp.tv_usec
return (c - p) / 1000000.0
I guess if any of those operands are int rather than long, then it could
overflow?
I don't have a MAC, but can you print the timestamp just after it's calculated
in the above function, before returning.