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.
|