PMNEWCONTEXTZONE(3)
π PMNEWCONTEXTZONE π
okay so bestie, welcome to the pmNewContextZone page, part of the Library Functions Manual for PCP β¨ like it literally sets up a reporting timezone based on a PMAPI context, and honestly? iconic behaviour.
πΈ NAME πΈ
pmNewContextZone β establish a reporting timezone based on a PMAPI context π°οΈβ¨
π C SYNOPSIS π
#include <pcp/pmapi.h>
int pmNewContextZone(void);
cc ... -lpcp
π DESCRIPTION π
so here's the tea, bestie. the current reporting timezone is the thing that decides which timezone pmCtime(3) and pmLocaltime(3) are gonna use. it's giving "the vibe setter" fr fr π¦
now, pmNewContextZone has two whole moods depending on what your current PMAPI context is:
- if your current PMAPI context is an archive, it pulls the timezone straight out of the archive label record and uses that to set the current reporting timezone. no cap, it just reads the label π¦β¨
- if your current PMAPI context corresponds to a host source of metrics, it goes and runs a
pmFetch(3)to grab the value for the metricpmcd.timezone, and uses that to set the current reporting timezone π
and in both cases?? it returns a value that identifies the current reporting timezone β and you can totally pass that lil value into a later call to pmUseZone(3) to restore this exact reporting timezone. it's literally save-and-restore energy π
π₯ DIAGNOSTICS π₯
PM_ERR_NOCONTEXTβ bestie the current PMAPI context is not valid ππ- other β a return value less than zero means a fatal error came out of a system call, and most likely it was
malloc(3). yeah. that one.
π«Ά SEE ALSO π«Ά
PMAPI(3), pmCtime(3), pmFetch(3), pmGetConfig(3), pmLocaltime(3), pmNewContext(3), pmNewZone(3), pmUseZone(3), pmWhichZone(3), pcp.conf(5), pcp.env(5) and environ(7) π
Performance Co-Pilot π PCP π PMNEWCONTEXTZONE(3)
and that's the whole page bestie, mwah π go set that reporting timezone, you absolute main character πβ¨
π¦ where this page comes from
- arch rolling: pcp 7.2.2-2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0
- centos-stream 10: pcp-doc 7.1.5-6.el10 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.0.1-1.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.2.1-1.fc43
- fedora 43: pcp-doc 7.2.2-1.fc43
- fedora 43: pcp-doc 7.2.2-2.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.1.0-6.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.2.1-1.fc44
- fedora 44: pcp-doc 7.2.2-1.fc44
- fedora 44: pcp-doc 7.2.2-2.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- ubuntu resolute: libpcp4-dev 7.1.1-1
- ubuntu stonking: libpcp4-dev 7.2.1-2build1
- Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms