Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pmiaddmetric(3) [centos man page]

PMIADDMETRIC(3) 					     Library Functions Manual						   PMIADDMETRIC(3)

NAME
pmiAddMetric - add a new metric definition to a LOGIMPORT context C SYNOPSIS
#include <pcp/pmapi.h> #include <pcp/impl.h> #include <pcp/import.h> int pmiAddMetric(const char *name, pmID pmid, int type, pmInDom indom, int sem, pmUnits units); cc ... -lpcp_import -lpcp Perl SYNOPSIS use PCP::LogImport; pmiAddMetric($name, $pmid, $type, $indom, $sem, $units); DESCRIPTION
As part of the Performance Co-Pilot Log Import API (see LOGIMPORT(3)), pmiAddMetric is used to define a new metric. The metric's name must follow the naming conventions described in PCPIntro(1) and should be unique for each LOGIMPORT context. The other arguments are in effect the fields of a pmDesc structure. Refer to pmLookupDesc(3) for a complete description of the values and semantics of the components of this structure, and hence the valid argument values for pmiAddMetrics. The internal identifier for the metric may be given using the pmid argument and must be unique for each LOGIMPORT context. The value for pmid which would typically be constructed using the pmid_build macro, e.g. pmid_build(PMI_DOMAIN, 0, 3) for the fourth metric in first ``cluster'' of metrics in the Performance Metrics Domain PMI_DOMAIN (which is the default for all meta data created by the LOGIMPORT li- brary). Alternatively, pmid may be PM_IN_NULL and pmiAddMetric will assign a unique pmid (although this means the pmid remains opaque and the application must use pmiPutValue(3) or pmiPutValueHandle(3) and cannot use pmiPutResult(3) to add data values to the PCP archive). type defines the data type of the metric and must be one of the PM_TYPE_... values defined in <pcp/import.h>. The instance domain for the metric is defined by indom and may be PM_INDOM_NULL for a metric with a singular value, else the value for in- dom would normally be constructed using the pmInDom_build macro, e.g. pmInDom_build(LOGIMPORT,0) for the first instance domain in the Per- formance Metrics Domain LOGIMPORT (which is the default for all meta data created by the LOGIMPORT library). Multiple metrics can share the same instance domain if they have values for a similar (or more usually, identical) set of instances. The semantics of the metric (counter, instantaneous value, etc.) is specified by the sem argument which would normally be the result of a call to the convenience constructor method pmiUnits(3). DIAGNOSTICS
pmiAddMetric returns zero on success else a negative value that can be turned into an error message by calling pmiErrStr(3). SEE ALSO
PCPIntro(1), LOGIMPORT(3), pmiErrStr(3), pmiPutResult(3), pmiPutValue(3), pmiPutValueHandle(3), pmiUnits(3) and pmLookupDesc(3). Performance Co-Pilot PMIADDMETRIC(3)

Check Out this Related Man Page

PMGETINDOMARCHIVE(3)					     Library Functions Manual					      PMGETINDOMARCHIVE(3)

NAME
pmGetInDomArchive - get instance identifiers for a performance metrics instance domain C SYNOPSIS
#include <pcp/pmapi.h> int pmGetInDomArchive(pmInDom indom, int **instlist, char ***namelist); cc ... -lpcp DESCRIPTION
Provided the current Performance Metrics Application Programming Interface (PMAPI) context is associated with an archive log, pmGetInDo- mArchive will scan the union of all the instance domain metadata for the instance domain indom, and return via instlist the internal instance identifiers for all instances, and via namelist the full external identifiers for all instances. This routine is a specialized version of the more general PMAPI routine pmGetInDom. The number of instances found is returned as the function value (else less than zero to indicate an error). The value for the instance domain indom is typically extracted from a pmDesc structure, following a call to pmLookupDesc(3) for a particu- lar performance metric. The resulting lists of instance identifiers (instlist and namelist), and the names that the elements of namelist point to, will have been allocated by pmGetInDomArchive with two calls to malloc(3C), and it is the responsibility of the caller to free(instlist) and free(namelist) to release the space when it is no longer required. When the result of pmGetInDomArchive is less than one, both instlist and namelist are undefined (no space will have been allocated, and so calling free(3C) is a singularly bad idea). PCP ENVIRONMENT
Environment variables with the prefix PCP_ are used to parameterize the file and directory names used by PCP. On each installation, the file /etc/pcp.conf contains the local values for these variables. The $PCP_CONF variable may be used to specify an alternative configura- tion file, as described in pcp.conf(5). Values for these variables may be obtained programmatically using the pmGetConfig(3) function. SEE ALSO
PMAPI(3), pmGetConfig(3), pmGetInDom(3), pmLookupDesc(3), pmLookupInDomArchive(3), pmNameInDomArchive(3), pcp.conf(5) and pcp.env(5). DIAGNOSTICS
PM_ERR_NOTARCHIVE the current PMAPI context is not associated with an archive log PM_ERR_INDOM_LOG indom is not a defined instance domain identifier for the archive log Performance Co-Pilot PCP PMGETINDOMARCHIVE(3)
Man Page