pcp
[Top] [All Lists]

Re: [pcp] mark records in archive INTERP mode

To: "Frank Ch. Eigler" <fche@xxxxxxxxxx>, pcp developers <pcp@xxxxxxxxxxx>
Subject: Re: [pcp] mark records in archive INTERP mode
From: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date: Wed, 2 Dec 2015 09:46:49 +1100
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <20151201210632.GD31003@xxxxxxxxxx>
References: <20151201210632.GD31003@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
G'day Frank.

On 02/12/15 08:06, Frank Ch. Eigler wrote:
Hi -

Talking in context of pmrep and multi-archives, and browsing
random sources, I came across this bit in pmwebapi/pmgraphite.cxx,
done after a pmFetch on an archive in PM_MODE_INTERP.

assert ((size_t)result->numpmid == unique_pmids.size()); // PMAPI guarantee?

In other words, this asserts that pmFetch in INTERP mode never returns
MARK records.  I'm concerned that, just reading documentation or
skimming libpcp/src/interp.c, I can't tell whether this guarantee is
there or not.  The "mark record" term isn't in the man3 pages at all.

If the guarantee is real, we should document it;
if the guarantee isn't real, it should still be documented,
    and pmwebd would need a patch like [attached]

<mark> records are NEVER returned from pmFetch() ... because the semantics are get the "next" value for at least one of these metrics.

<mark> records can be returned from pmFetchArchive() ... because the semantics are fetch the "next" record.

So for users of pmFetch (for PM_MODE_INTERP, or PM_MODE_FORW, or PM_MODE_BACK), the <mark> records are completely transparent, and your assertion is fine.

For users of pmFetchArchive() (is there anyone other than me in this group?), it might be useful to document that the number of metrics returned in the pmResult might be zero, and by the way, this is a <mark> record. I'll add verbage in this man page.

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