NNG_STAT_TYPE(3)

πŸ“¦
version 1.12.0 Β· 4 versions
, in ubuntu stonking

✨ 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 (see nng_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 the nng_stat_string() function to get the value. that's the only way, periodt. πŸŽ€
  • NNG_STAT_BOOLEAN β€” a boolean value. the nng_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