QMCGROUP(3)
π NAME π
QmcGroup β it's giving container, bestie. Specifically: a container representing a single fetch group of metrics from multiple sources. that's the whole job. slay.
πΈ C++ SYNOPSIS πΈ
#include <QmcGroup.h>
c++ ... -lpcp_qmc -lpcp
π¦ DESCRIPTION π¦
okay so picture this: a QmcGroup object is a container for contexts and metrics that should be fetched at the same time. like, they're a friend group, they show up together, no stragglers. π
the class manages the QmcContext(3) objects, the timezones, and the bounds for every context you create with QmcGroup::use and QmcGroup::addMetric. she's organized. she's the group chat admin. iconic behavior.
β¨ CONSTRUCTORS & DESTRUCTOR β¨
~QmcGroup();β the destructor. she destroys all metrics and contexts created by this group. it's giving "closing the group chat forever" πQmcGroup(bool restrictArchives = false);β construct a brand new fetch group. if you setrestrictArchives, it will restrict the creating of multiple archive contexts created from the same host. (yes, that's the actual wording, and yes, it means what it says.)
π CONTEXTS π
so the default context of the group is defined as the first context created with QmcGroup::use before the first call to QmcGroup::addMetric. if no context is created before the first metric is added, the localhost is used as the default context. therefore β and this is the important part, bestie, underline it β if any metrics specifications contain archive sources, an archive source must have been created with QmcGroup::use to avoid an error for mixing context types. mixing context types = drama. we do not want the drama. π
uint_t numContexts() const;β how many valid contexts got created in this group. the headcount. πQmcContext const& context(uint_t index) constβ hand me a handle to a context (read-only edition).QmcContext& context(uint_t index);β hand me a handle to a context, but make it modifiable. touch grass, touch the context.int mode() const;β returns the type of context, which is one ofPM_CONTEXT_LOCAL,PM_CONTEXT_HOST, orPM_CONTEXT_ARCHIVE.QmcContext* which() const;β a handle to the current context of this group. β οΈ heads up though: this does not callpmUseContext(3), so it may not be the currentPMAPI(3)context. they are different things, don't get it twisted.uint_t contextIndex() constβ the index to the current group context.int use(int type, char const* source);β use the context oftypefromsource. if a context to this source already exists in this group, that context becomes the currentPMAPI(3)context. otherwise a new context gets created. the result is thePMAPI(3)context handle for theQmcGroup::context, or aPMAPI(3)error code if the context failed. π«Άbool defaultDefined() const;β returnstrueif a default context has been determined. vibe check: passed or not passed.int useDefault();β use the default context. if a default context has not been created, the context to the local host will be attempted. a result less than zero means the method failed, with thePMAPI(3)error encoded in the result. πvoid createLocalContext();β create and use a context to the local host. a result less than zero indicates that the method failed with thePMAPI(3)error encoded in the result.
π₯ METRICS π₯
these addMetric methods are the ones you use to create new metrics, because the QmcMetric constructors are private (not yours to touch, bestie, they're behind the velvet rope). these methods will always return a pointer to a QmcMetric object β however, you should check the QmcMetric::status() field to make sure the metric is actually valid. always check the status. always. π
QmcMetric* addMetric(char const* str, double theScale = 0.0, bool active = false);β add the metricstrto the group, with a scaling factor ofscale. ifactiveis set, the metric will use only active instances (seeQmcMetric(3)).QmcMetric* addMetric(pmMetricSpec* theMetric, double theScale = 0.0, bool active);β add the metrictheMetricto the group, with a scaling factor ofscale. ifactiveis set, the metric will use only active instances (seeQmcMetric(3)).int fetch(bool update = true);β fetch all the metrics in all the contexts in this group. ifupdateequalstrue, all counter metrics will be automatically converted to rates (seeQmcMetric(3)). auto-conversion, no manual labor, we love efficiency. β¨int setArchiveMode(int mode, const struct timeval *when, int interval);β set the mode and time to access all archive contexts in this group. seepmSetMode(3)for more details.
π TIMEZONES π
these methods assist in the management of multiple timezones and help to control the current timezone. timezone girlies, this section is for you. π
enum TimeZoneFlag { localTZ, userTZ, groupTZ, unknownTZ };β an enumeration used to describe the origin of the default timezone.localTZ,userTZandgroupTZindicate that the timezone was set withQmcGroup::useLocalTZ,QmcGroup::useTZ(QString const&)andQmcGroup::useTZ()respectively.unknownTZindicates that a timezone has not been set.userTZindicates that the timezone was β and that's where the original manpage literally just stops mid-sentence π the sentence does not finish. we respect the cut-off. we do not invent an ending.int useTZ();β use the timezone of the current group context as the default.int useTZ(const QString &tz);β add and usetzas the default timezone of this group.int useLocalTZ();β use the timezone of the localhost as the default for this group.void defaultTZ(QString &label, QString &tz);β return thelabelandtzstring of the default timezone of this group.TimeZoneFlag defaultTZ() constβ return the origin of the default timezone.int useDefaultTZ();β set the timezone to be the default timezone as defined in a previous call toQmcGroup::useTZorQmcGroup::useLocalTZ.struct timeval const& logStart() const;β return the earliest starting time of any archives in this group. β οΈ assumes thatQmcGroup::updateBoundshas been called. no bounds update, no accurate answer, no cap.struct timeval const& logEnd() const;β return the latest finish time of any archives in this group. β οΈ also assumes thatQmcGroup::updateBoundshas been called.void updateBounds();β determine the earliest start and latest finish times of all archives in this group. do this first. it's the pre-game. π§
π DEBUGGING π
void dump(ostream &os);β dump state information about this group toos. spill the tea, girl. π
π DIAGNOSTICS π
error messages are generated using pmprintf(3) but are not flushed. it is the responsibility of the user to call pmflush(3) to output any messages. so likeβ¦ she wrote the message, she did not send it. you have to send it. π«
additional diagnostics may be activated by adding the option pmc to the global debugging specification, as described in pmSetDebug(3).
π SEE ALSO π
PMAPI(3), QMC(3), QmcContext(3), QmcMetric(3), pmflush(3), pmprintf(3) and pmSetMode(3). the whole squad, fr fr. π«Ά
okay bestie that's the whole page, you ate it π this one's from Performance Co-Pilot, brought to you by SGI, and she answers to the name QMCGROUP(3). go forth and fetch. β¨π
π¦ 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) 2005 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