pcp
[Top] [All Lists]

Re: [pcp] qa/842 failing on Mac OS X ... wrong values from pmiostat

To: pcp@xxxxxxxxxxx
Subject: Re: [pcp] qa/842 failing on Mac OS X ... wrong values from pmiostat
From: Mark Goodwin <mgoodwin@xxxxxxxxxx>
Date: Thu, 17 Mar 2016 10:54:28 +1100
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <56E9E05D.7040705@xxxxxxxxxx>
References: <56E9D72E.8090200@xxxxxxxxxxxxxxxx> <56E9E05D.7040705@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0
On 03/17/2016 09:38 AM, Mark Goodwin wrote:
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.

Ken, could you try the attached patch on MAC/OSX please :



Attachment: pcp-iostat-timedelta.patch
Description: Text Data

<Prev in Thread] Current Thread [Next in Thread>