---
name: "QmcDesc"
section: "3"
platform: "linux"
package: "pcp"
version: "7.2.2-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/QmcDesc"
---

# QmcDesc(3)

container for a metric description

## NAME

**QmcDesc** - container for a metric description

## C++ SYNOPSIS

**#include \<QmcDesc.h\>**

**c++ ... -lpcp\_qmc -lpcp**

## DESCRIPTION

A **QmcDesc** object is a container for a metric descriptor (**pmDesc**, see [**PMAPI**(3)](/PMAPI/3.md)) and units.

## CONSTRUCTORS & DESTRUCTOR

- **~QmcDesc();**

  Destructor.

- **QmcDesc(pmID pmid);**

  Construct a container for the descriptor for *pmid*. The descriptor is obtained from the current [**PMAPI**(3)](/PMAPI/3.md) context using [**pmLookupDesc**(3)](/pmLookupDesc/3.md).

## DESCRIPTION

- **int status() const;**

  A status less than zero indicates that the descriptor could not be obtained, the [**PMAPI**(3)](/PMAPI/3.md) error is encoded in the result.

- **pmID id() const;**

  Return the **pmID** for this descriptor.

- **pmDesc desc() const;**

  Return a copy of the actual metric descriptor.

- **const pmDesc \*descPtr() const;**

  Return a pointer to the actual descriptor to avoid using a pointer to a temporary.

## UNITS

- **const QString &units() const;**

  The complete unit string for this descriptor.

- **const QString &shortUnits() const;**

  The unit string using abbreviations.

- **bool useScaleUnits() const;**

  Returns **true** if the units have been set by a call to **QmcDesc::setScaleUnits**.

- **const pmUnits &scaleUnits() const;**

  Return the scaling units for this descriptor.

- **void setScaleUnits(const pmUnits &units);**

  Set the scaling units for this descriptor.

## DIAGNOSTICS

Error messages are generated using [**pmprintf**(3)](/pmprintf/3.md) but are not flushed. It is the responsibility of the user to call [**pmflush**(3)](/pmflush/3.md) to output any messages.

Additional diagnostics may be activated by adding the option **pmc** to the global debugging specification, as described in [**pmSetDebug**(3)](/pmSetDebug/3.md).

## SEE ALSO

[**PMAPI**(3)](/PMAPI/3.md), [**QMC**(3)](/QMC/3.md), [**pmflush**(3)](/pmflush/3.md), [**pmLookupDesc**(3)](/pmLookupDesc/3.md) and [**pmprintf**(3)](/pmprintf/3.md).
