QMCMETRIC(3)
π QMCMETRIC π
okay bestie, so this is QMCMETRIC, a little library function from the C++ side of the house, and honestly? it's giving container energy. it lives in the Library Functions Manual section (that's section 3, iykyk), and it's here to hold onto one single metric and every last one of its values. cute, right? let's get into it π
β¨ NAME β¨
QmcMetric β a container for a metric and all its values π
πΈ C++ SYNOPSIS πΈ
#include <pcp/pmc/Metric.h>
c++ ... -lpcp_qmc -lpcp
yes bestie, you literally link against -lpcp_qmc and -lpcp. both. don't skip one, she'll notice π
π¦ DESCRIPTION π¦
So a QmcMetric object is a container for a single metric and all its values. One metric, all the values, no sharing, no drama. π«Ά
The QmcMetricValue structure is what actually holds the instance index, the values, and the errors of each instance. And if you've got a singular metric (aka the no-instance-domain girlies)? Then you just get one single QmcMetricValue object. One and done. π
A QmcMetric object is made up of:
- a list of QmcMetricValue objects,
- indexes to the descriptors in the metric's QmcGroup and QmcContext,
- and flags that say whether the instances are explicit or implicit, and whether only active metrics are required after
QmcMetric::updateIndomgets called.
like. she's organized. she has layers. main character energy fr fr π
π§ CONSTRUCTORS π§
okay so important: metrics should be constructed through the QmcGroup::addMetric methods. and the reason is not just vibes β it's because that's what makes sure the references to the metric's context, descriptor, and instance domain are all correctly initialized. do it the other way and it's giving chaos π
β INSTANCES β
For metrics that have an instance domain, you can add and remove any instance you want, and you can also update the instance list so it reflects changes in a dynamic instance domain. flexible queen π
bool updateIndom();β Updates the metric so it includes the new instances. This method will first callQmcContext::updateto update the instance domain. And here's the tea: if the active flag is set in theQmcGroup::addMetriccall, only instances will be exported by the metric; otherwise the metric will export all the instances listed in the domain.
heads up bestie: the ordering of instances may change as a result of this call. BUT β instances that already existed will keep their current and previous values and errors, even if they end up in a different order. so nobody loses their history. slay π
int addInst(QString const& name);β Adds the instance name to the metric. If the instance doesn't exist in the instance domain, aPMAPI(3)error gets returned. and no cap: this method ignores the value of the active flag that was set in the QmcMetric constructor. she does what she wants πvoid removeInst(uint_t index);β Removes the instance at position index from the metric. bye girl π
π₯ DIAGNOSTICS π₯
Error messages get generated using pmprintf(3) β but they are not flushed. so it is literally your responsibility, as the user, to call pmflush(3) to actually output any of those messages. don't forget or they just sit there. silently. waiting. π
Additional diagnostics can be activated by adding the option pmc to the global debugging specification, as described in pmSetDebug(3). go off, debug mode π§β¨
π SEE ALSO π
PMAPI(3), QMC(3), QmcContext(3), QmcGroup(3), pmflush(3) and pmprintf(3). the whole squad, together, as they should be π«Ά
and that's the page, bestie!! this one came from Performance Co-Pilot, courtesy of SGI β and yes, she's still rocking the QMCMETRIC(3) name and that same (3) section number, no rebrand needed. go read your metrics, angel. mwah ππ β¨
π¦ 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