PMSORTINSTANCES(3)
π PMSORTINSTANCES π
okay bestie, so this one lives in the Library Functions Manual (that's the 3 in pmSortInstances(3), iykyk) and it's genuinely the glow-up your metric results have been waiting for β¨
πΈ NAME πΈ
pmSortInstances β sort performance metric values on instance identifier
like... it puts the instances in order. that's the whole vibe. π
β¨ C SYNOPSIS β¨
#include <pcp/pmapi.h>
void pmSortInstances(pmResult *result);
cc ... -lpcp
π¦ DESCRIPTION π¦
so the routine pmSortInstances is the one you call when you need to guarantee that, for each performance metric in the result that came back from pmFetch(3), the instances are chillin' in ascending instance identifier sequence. no chaos, no random ordering, just a nice tidy lineup π
and why do we care? because this is lowkey essential when you're computing rates from two consecutive samples. the way that mismatched instance ordering will absolutely ruin your rate math... not on our watch. π«Ά
π COMPATIBILITY π
okay this part is the lore, and you need the lore bestie π
- back prior to PCP 7.0, the
timestampfield in thepmResultstruct was astruct timeval. that's the old way. - to support the PMAPI transition, you can still use the old interface and its semantics if you recompile your apps with
-DPMAPI_VERSION=2. yes, a compile flag, she's retro like that πΎ - also, for a time in PCP 6.x, there was a routine with the same semantics as the current
pmSortInstances, and it was calledpmSortHighResInstances. and there was a struct with the same definition as the currentpmResultstruct, calledpmResultHighRes.
β οΈ real talk: both of those are now deprecated, and compile-time support forpmSortHighResInstancesandpmResultHighReswill be removed in a future release. so don't build anything new on them, okay? that's the tea π
π SEE ALSO π
go read those, they're iconic, I promise πβ¨
Performance Co-Pilot Β· PCP Β· PMSORTINSTANCES(3) β mwah, that's the whole page, thanks for coming to my TED talk, stay sorted and stay slay ππ§πΈ
π¦ 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) 2022 Red Hat. All Rights Reserved
- Copyright (c) 2000-2004 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