PMSORTINSTANCES(3)

πŸ“¦
version 6.3.8 Β· 2 versions
, in centos-stream 9, debian trixie, opensuse-leap 16.0, ubuntu noble, ubuntu questing

🌸 PMSORTINSTANCES(3) 🌸

ok so bestie, welcome to the Library Functions Manual page for pmSortInstances and pmSortHighResInstances β€” yes those names are a mouthful, iykyk, but they're literally so useful. sit with me, this one's short and sweet πŸ“


✨ NAME ✨

pmSortInstances, pmSortHighResInstances β€” sort performance metric values on instance identifier πŸ’…


πŸ¦‹ C SYNOPSIS πŸ¦‹

first thing you do, you pull in the header:

#include <pcp/pmapi.h>

then here are the two functions, no cap:

void pmSortInstances(pmResult *result);
int pmSortHighResInstances(pmHighResResult *result);

and when you build, you link against libpcp like this:

cc ... -lpcp

πŸ’– DESCRIPTION πŸ’–

okay so here's the vibe. the routine pmSortInstances may be used to guarantee that for each performance metric in the result from pmFetch(3) or pmFetchHighRes(3), the instances are in ascending instance identifier sequence. periodt. πŸ”₯

and like, why do you even care? because this is so useful when you're computing rates from two consecutive samples β€” you need the instances lined up in the same order on both sides or the math goes feral πŸ’€. pmSortInstances gets them in order so you're not out here matching instances by hand like a peasant.

note that pmSortHighResInstances has a return type of int while pmSortInstances returns void β€” the page doesn't spill any tea on what that int means, so don't @ me πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

go read these next, fr fr:


and that's the whole page, bestie, you ate it πŸ’…βœ¨

sign-off moment: this cutie pie comes to you from the Performance Co-Pilot girlies over at PCP, and it's page PMSORTINSTANCES(3) β€” the original doesn't stamp a date on it, so it's giving timeless icon energy πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from