NNG_STAT(5)
π nng_stat β statistic π
okay bestie, welcome to the nng_stat(5) page, aka the reference manual's take on the humble statistic β¨ buckle up, it's giving data-structure-cute π
π NAME π
nng_stat β statistic. that's it, that's the name, no notes π
π SYNOPSIS π
#include <nng/nng.h>
typedef struct nng_stat nng_stat;
so like, that's the whole vibe. a typedef. she's simple, she's iconic π
πΈ DESCRIPTION πΈ
An nng_stat represents a statistic. literally what it says on the tin, no cap.
Every single statistic has a name (peep nng_stat_name()) and a description (that's nng_stat_desc()), and she's also typed β yes, we stan a typed queen β which you get from nng_stat_type().
Most statistics are numeric π’, which means they carry a value (nng_stat_value()) and like, super often they also have a unit that the value is measuring (nng_stat_unit()).
But some statistics are just, like, strings?? (nng_stat_string()) β so they carry no numeric value at all. she's decorative, she's for the lore, and that's valid π
Statistics are organized as a tree π³, and any given statistic can have siblings β that's nng_stat_next(), the "who else is in my group chat" function. BUT lowkey important: generally only NNG_STAT_SCOPE statistics have children (via nng_stat_child()), because those are the ones that act as placeholders in the tree and carry no value themselves. they're the parents, the organizers, the mom friends of the tree π«Ά
You collect a whole tree of statistics using nng_stats_get(), and when you're done with it you free it with nng_stats_free(). This whole collection process is generally done in a way that minimizes impact on your running operations... but ngl, there's still some impact caused by collecting statistics. bestie said "i'll be quick" and she meant it, but she's still showing up at your door π
Wanna know when a statistic's value was captured? That's nng_stat_timestamp(), and it's genuinely so useful for measuring rates of change in certain statistics. timestamp girlies stay winning β°
β οΈ Note β οΈ The presence, names, and meanings of any given statistic are subject to change at any time. These statistics are provided as an aid for debugging, and should generally not be relied upon for programmatic behaviors. fr fr, don't build your whole app on these, they will ghost you π
β οΈ Note β οΈ Statistics may be disabled by build-time configuration options, in order to reduce program size and run-time overheads. so if they're not showing up for you, it's not you, it's the build config π
π SEE ALSO π
libnng(3)nng_stats_free(3)nng_stats_get(3)nng_stat_child(3)nng_stat_desc(3)nng_stat_find(3)nng_stat_find_dialer(3)nng_stat_find_listener(3)nng_stat_find_socket(3)nng_stat_name(3)nng_stat_next(3)nng_stat_string(3)nng_stat_timestamp(3)nng_stat_type(3)nng_stat_unit(3)nng_stat_value(3)nng(7)
aaaand that's the page!! π this lil love letter lives in the NNG Reference Manual, dated 2026-06-30, and it's filed under section 5. mwah, go read the linked pages, ily, bye π¦β¨πΈ
π¦ where this page comes from
- ubuntu stonking: libnng-dev 1.12.0-1 Β· MIT OR Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms