QMCMETRIC(3)

πŸ“¦
version 7.2.2 Β· 3 versions
, in arch rolling, centos-stream 10, fedora 43, fedora 44, ubuntu resolute, ubuntu stonking

πŸ’– 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::updateIndom gets 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 call QmcContext::update to update the instance domain. And here's the tea: if the active flag is set in the QmcGroup::addMetric call, 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, a PMAPI(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