---
name: "pmsortinstances"
section: "3"
platform: "linux"
package: "libpcp3-dev"
version: "4.3.2+really4.3.1-0.1"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/pmSortInstances"
---

# pmsortinstances(3)

sort performance metric values on instance identifier

Part of [pmSortInstances(3)](/pmSortInstances/3.md).

## NAME

**pmSortInstances** - sort performance metric values on instance identifier

## C SYNOPSIS

**#include \<pcp/pmapi.h\>**

**void pmSortInstances(pmResult \****result***);**

**cc ... -lpcp**

## DESCRIPTION

The routine **pmSortInstances** may be used to guarantee that for each performance metric in the *result* from [**pmFetch**(3)](/pmFetch/3.md), the instances are in ascending instance identifier sequence.

This is most useful when trying to compute rates from two consecutive [**pmFetch**(3)](/pmFetch/3.md) results.

## SEE ALSO

[**PMAPI**(3)](/PMAPI/3.md) and [**pmFetch**(3)](/pmFetch/3.md).

## DIAGNOSTICS

None.
