pcp
[Top] [All Lists]

[Bug 1284417] Python PMAPI pmSetMode does not allow None timeval

To: pcp@xxxxxxxxxxx
Subject: [Bug 1284417] Python PMAPI pmSetMode does not allow None timeval
From: bugzilla@xxxxxxxxxx
Date: Tue, 24 Nov 2015 16:04:55 +0000
Auto-submitted: auto-generated
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <bug-1284417-355098@xxxxxxxxxxxxxxxxxxx>
References: <bug-1284417-355098@xxxxxxxxxxxxxxxxxxx>
https://bugzilla.redhat.com/show_bug.cgi?id=1284417



--- Comment #2 from Marko Myllynen <myllynen@xxxxxxxxxx> ---
Thanks, I tested the change and it seems to work in that sense that my test
code runs. I see only one in-tree user pmSetMode(PM_MODE_FORW, NULL, 0)
(src/pmlogreduce/scan.c) but I'm not yet sure would this be useful elsewhere.

However, there's also one case where the man pages could be clarified a bit:

The pmSetMode(1) man page states:

...
       As  a  special  case, if when is NULL then the mode and delta arguments
       are used as described above, but the current time in the archive is not
       altered.
...

The pmFetchArchive(1) man page states:

...
       The result is instantiated with all of the metrics (and instances) from
       the next archive record, consequently there is no notion of a  list  of
       desired  metrics,  and  the  instance  profile  of the PMAPI context is
       ignored.
...

But with code like:

...
        self.context.pmSetMode(c_api.PM_MODE_FORW, None, 0)
        while self.context.type == c_api.PM_CONTEXT_ARCHIVE and True:
            result = self.context.pmFetchArchive()
            print "Fetch @ " + str(result.contents.timestamp)
...

I see:

...
$ python ~/pmapi-test.py -a pVZ3Sj.localhost
Fetch @ 1448379062.065
Fetch @ 1448379064.064
Fetch @ 1448379066.065
...

Based on the above quotes from pmSetMode(1) and pmFetchArchive(1) I was perhaps
expecting 1448379062.065 being printed repeatedly here.

I'll attach the test archive and the crude test script just in case (I see the
same behaviour with both pmFetch() pmFetchArchive()).

Thanks.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug 
https://bugzilla.redhat.com/token.cgi?t=rSC4eyiMw3&a=cc_unsubscribe

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