pcp
[Top] [All Lists]

Re: pcp updates - duplicate names allowed in the PMNS by default

To: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Subject: Re: pcp updates - duplicate names allowed in the PMNS by default
From: fche@xxxxxxxxxx (Frank Ch. Eigler)
Date: Tue, 03 Feb 2015 10:23:38 -0500
Cc: pcp@xxxxxxxxxxx
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <54D08763.80100@xxxxxxxxxxxxxxxx> (Ken McDonell's message of "Tue, 03 Feb 2015 19:31:31 +1100")
References: <54D08763.80100@xxxxxxxxxxxxxxxx>
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)
kenj wrote:

> [...]
> Case 2 - pmwebapi
> pmwebapi/pmwebapi.cxx
>     rc = pmNameID (fieldvsp->pmid, &fieldname);
>     rc = pmNameID (pvs->pmid, &metric_name);
>
> In both the places above, there appears to be an assumption that a PMID
> -> one name at most [...]

A baby step could be just a documentation change, namely to inform
pmwebapi users that the returned "name" field is -a- name for the
PMID, rather than -the- name or -all- names.  (The pmwebapi.3 man page
doesn't even go into detail and calls that field self-explanatory.)

A possible step would be to pass back all names for pmid-metadata, one
could add a JSON vector subfield like
    "names": ["foo.bar", "foo.bar2"]
to the /pmapi/NNNNN/_metric query.

A likely necessary step would be to tweak the /_fetch code, so that
the result "name":"NAME*" fields match up with the /_fetch?name=NAME
requests.  This would mean teaching pmwebapi_respond_metric_fetch() to
store not just resolved "pmID *metrics;" but a vector of pre-resolved
"metric-names".  I can give that a go if you like.


- FChE

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