pmTrimNameSpace man page

pmTrimNameSpace — prune a performance metrics name space

C Synopsis

#include <pcp/pmapi.h>

int pmTrimNameSpace(void);

cc ... -lpcp

Description

In some (rare) cases it is helpful to prune the Performance Metrics Name Space (PMNS) to match the available metrics.

The default PMNS that is accessible to a Performance Metrics Application Programming Interface (PMAPI) client is provided by the current PMAPI context:

If the default PMNS is in effect then calling pmTrimNameSpace is a no-op and returns zero with no change to the PMNS.

PMAPI clients also have the option of over-riding the default PMNS by loading a local PMNS from a file (see pmns(5) for the format) by calling pmLoadASCIINameSpace(3) or pmLoadNameSpace(3) and this is when some PMNS pruning may be useful.

If a local PMNS is in effect when pmTrimNameSpace is called then the first action is to restore the PMNS to the state as of the completion of the last pmLoadASCIINameSpace(3) or pmLoadNameSpace(3), so that the effects of consecutive calls to pmTrimNameSpace are not additive.

The subsequent actions of pmTrimNameSpace depend on the type of the current PMAPI context.

On success, pmTrimNameSpace returns zero.

See Also

pmlogger(1), PMAPI(3), pmLoadASCIINameSpace(3), pmLoadNameSpace(3), pmNewContext(3) and pmns(5).

Diagnostics

PM_ERR_NOPMNS

there has been some earlier problem with establishing the relevant PMNS

PM_ERR_NOCONTEXT

the current PMAPI context is invalid

Referenced By

pmFetchArchive(3), pmGetPMNSLocation(3), pmLoadASCIINameSpace(3), pmLoadNameSpace(3).

PCP Performance Co-Pilot