pmLookupDesc
requests with a pmDesc
structure whose type
field has the special value PM_TYPE_NOSUPPORT
. Values of fields other than pmid
and type
are immaterial, but Example 2.19, “ Setting Values” is typically benign:
Example 2.19. Setting Values
pmDesc dummy = { .pmid = PMDA_PMID(3,0), /* pmid, fill this in */ .type = PM_TYPE_NOSUPPORT, /* this is the important part */ .indom = PM_INDOM_NULL, /* singular,causes no problems */ .sem = 0, /* no semantics */ .units = PMDA_PMUNITS(0,0,0,0,0,0) /* no units */ };
pmFetch
requests with a pmResult
in which no values are returned for the unsupported metric. This is marginally friendlier than the other semantically acceptable option of returning an illegal PMID error or PM_ERR_PMID
.
pmExtractValue
, pmConvScale
, pmAtomStr
, pmTypeStr
, and pmPrintValue
) return the PM_ERR_CONV
error or an appropriate diagnostic string, if an attempt is made to operate on a value for which type
is PM_TYPE_NOSUPPORT
.
type
field in the pmDesc
structure, they should not manipulate values for unsupported metrics. Even if tools ignore type
in the metric's description, following these development guidelines ensures that no misleading value is ever returned; so there is no reason to call the extraction, conversion, and printing functions.