---
name: "pmSortHighResInstances"
section: "3"
platform: "linux"
package: "libpcp3-dev"
version: "6.3.8-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/pmSortInstances"
---

# pmSortHighResInstances(3)

sort performance metric values on instance identifier

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

## NAME

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

## C SYNOPSIS

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

```
void pmSortInstances(pmResult *result);
int pmSortHighResInstances(pmHighResResult *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) or [**pmFetchHighRes**(3)](/pmFetchHighRes/3.md), the instances are in ascending instance identifier sequence.

This is useful when computing rates from two consecutive samples.

## SEE ALSO

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