NNG_STAT_TYPE(3)
β¨ NNG_STAT_TYPE β¨
okay bestie, welcome to nng_stat_type(3) from the NNG Reference Manual ππ this one's a lil baby page but it's important, it's the vibe check for your statistics, fr fr.
π NAME π
nng_stat_type β get statistic type π
π¦ SYNOPSIS π¦
#include <nng/nng.h>
typedef struct nng_stat nng_stat;
enum {
NNG_STAT_SCOPE,
NNG_STAT_LEVEL,
NNG_STAT_COUNTER,
NNG_STAT_STRING,
NNG_STAT_BOOLEAN,
NNG_STAT_ID
};
int nng_stat_type(nng_stat *stat);
πΈ DESCRIPTION πΈ
so nng_stat_type() returns the type of the statistic stat. that's it, that's the whole job, and it does it flawlessly, no cap π
the type it hands back is gonna be one of these values, and every single one has main character energy of its own:
NNG_STAT_SCOPEβ this one is literally just a placeholder that provides scope, and it carries no value on its own. it's giving "group chat organizer" energy: not the tea itself, just the parent node with child statistics hanging off it (seenng_stat_child()).NNG_STAT_LEVELβ a numeric statistic, but its value is a level, so if you try to do rate calculations based on how this value changes? don't. that's not significant, bestie, i said what i said. πNNG_STAT_COUNTERβ a numeric statistic that represents an increasing count, typically of events, messages, or bytes. and the way that you can divide changes in this statistic by time to get a rate?? obsessed. π₯ (for example, throughput might be calculated as changes in a byte counter divided by the interval over which the change occurred.)NNG_STAT_STRINGβ this is a string, and it carries no numeric value. nope. instead you should use thenng_stat_string()function to get the value. that's the only way, periodt. πNNG_STAT_BOOLEANβ a boolean value. thenng_stat_value()function will return zero to represent a false value, and one to represent a true value. zero and one, that's it, iconic simplicity. β¨NNG_STAT_IDβ the statistic is a numeric ID. these are generally immutable values that represent an identity that might be used with another interface. π
π‘ Tip
for NNG_STAT_COUNTER and NNG_STAT_LEVEL statistics, the nng_stat_unit() function will provide more detail about the units measured by the static. iykyk, go get those units bestie π«Ά
π RETURN VALUES π
the statistic type for stat. that's the value, that's the answer, slay.
π ERRORS π
None.
like literally none. not a single error. it ate and left no crumbs, no crumbs at all. π
π SEE ALSO π
libnng(3), nng_stats_get(3), nng_stat_string(3), nng_stat_unit(3), nng_stat_value(3), nng_stat(5), nng(7)
okay and that's the whole page, bestie!! go forth and type-check your stats π
this cutie came out of the NNG Reference Manual, dated 2026-06-30 β that's the version and date, mwah, signing off, xoxo π β¨
π¦ 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