Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mmv_stats_init(3) [centos man page]

MMV_STATS_INIT(3)					     Library Functions Manual						 MMV_STATS_INIT(3)

NAME
mmv_stats_init - create and initialize Memory Mapped Value file C SYNOPSIS
#include <pcp/pmapi.h> #include <pcp/mmv_stats.h> void *mmv_stats_init(const char *name, int cluster, mmv_stats_flags_t flags, const mmv_metric_t *stats, int nstats, mmv_indom_t *indoms, int nindoms); cc ... -lpcp_mmv -lpcp DESCRIPTION
mmv_stats_init creates and initializes the content of the MMV(5) file, returning a handle that is used in subsequent MMV API calls. mmv_stats_stop performs an orderly shutdown of the mapping handle returned by an earlier initialization call. The file is created in the $PCP_TMP_DIR/mmv directory, name argument is expected to be a basename of the file, not the full path. The metadata content of the file does not change after the file has been created. The old file is removed unconditionally unless there was an error. cluster is the preferred MMV PMDA cluster ID to be used for the metrics originating from this call to mmv_stats_init. The flags provide additional control over the behaviour of the MMV PMDA - e.g. use of MMV_FLAG_PROCESS will ensure values are only exported when the instru- mented application is running - this is verified on each request for new values. stats is the array of mmv_metric_t elements of length nstats. Each element of the array describes one PCP metric. typedef struct { char name[MMV_NAMEMAX]; /* Name of the metric */ __uint32_t item; /* Item component of PMID */ mmv_metric_type_t type; /* Type of the metric */ mmv_metric_sem_t semantics; /* Semantics of the metric */ pmUnits dimension; /* Dimensions (TIME,SPACE,etc) */ __uint32_t indom; /* Instance domain identifier */ char *shorttext; /* Optional, one-line help */ char *helptext; /* Optional, full help text */ } mmv_metric_t; If indom is not zero and not PM_INDOM_NULL, then the metric has multiple values and there must be a corresponding indom entry in the indom list (uniquely identified by serial number). The stats array cannot contain any elements which have no name - this is considered an error and no metrics will be exported in this case. indoms is the array of mmv_indom_t elements of length nindoms. Each element of the array describes one PCP instance domain. typedef struct { __int32_t internal; char external[MMV_NAMEMAX]; } mmv_instances_t; typedef struct { __uint32_t serial; /* Unique serial number */ __uint32_t count; /* Number of instances */ mmv_instances_t *instances; /* Internal/external IDs */ char *shorttext; /* Short help text */ char *helptext; /* Long help text */ } mmv_indom_t; RETURNS
The function returns the address of the memory mapped region on success or NULL on failure. SEE ALSO
mmv_inc_value(3), mmv_lookup_value_desc(3) and mmv(5). Performance Co-Pilot MMV_STATS_INIT(3)

Check Out this Related Man Page

PMDELPROFILE(3) 					     Library Functions Manual						   PMDELPROFILE(3)

NAME
pmDelProfile - delete instance(s) from the current PMAPI instance profile C SYNOPSIS
#include <pcp/pmapi.h> int pmDelProfile(pmInDom indom, int numinst, int *instlist); cc ... -lpcp DESCRIPTION
The set of instances for performance metrics returned from a pmFetch(3) call may be filtered or restricted using an instance profile. There is one instance profile for each context the application creates at the Performance Metrics Application Programming Interface (PMAPI), and each instance profile may include instances from one or more instance domains (see pmLookupDesc(3)). pmDelProfile may be used to delete instance specifications from the instance profile of the current PMAPI context. In the simplest variant, the list of instances identified by the instlist argument for the indom instance domain are removed from the instance profile. The list of instance identifiers contains numinst values. The indom value would normally be extracted from a call to pmLookupDesc(3) for a particular performance metric, and the instances in instlist would typically be determined by calls to pmGetInDom(3) or pmLookupInDom(3). If indom equals PM_INDOM_NULL or numinst is zero, then all instance domains are selected for deletion. If instlist is NULL, then all instances in the selected domain(s) are removed from the profile. To disable all available instances in all domains, use pmDelProfile(PM_INDOM_NULL, 0, NULL). This is the only situation in which indom may be PM_INDOM_NULL. SEE ALSO
pmAddProfile(3), PMAPI(3), pmFetch(3), pmGetInDom(3), pmLookupDesc(3), pmLookupInDom(3), pmNewContext(3), pmUseContext(3) and pmWhichCon- text(3). DIAGNOSTICS
PM_ERR_PROFILESPEC indom was PM_INDOM_NULL and instlist was not empty CAVEAT
It is possible to delete non-existent instance domains and non-existent instances from an instance profile. None of the routines that use the instance profile will ever issue an error if you do this. The cost of checking, when checking is possible, outweighs any benefits. Performance Co-Pilot PCP PMDELPROFILE(3)
Man Page

Featured Tech Videos