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
|