From 566f932d422ffa9f6316d55cba21831173b1b2fc Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 31 Dec 2024 09:23:59 -0800 Subject: docs: statistics updates, document nng_stat_parent (fixes #1896) --- docs/ref/api/stats.md | 4 ++++ docs/ref/xref.md | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/docs/ref/api/stats.md b/docs/ref/api/stats.md index 2e0acfcd..1720f605 100644 --- a/docs/ref/api/stats.md +++ b/docs/ref/api/stats.md @@ -56,6 +56,7 @@ The {{i:`nng_stats_free`}} function deallocates the snapshot referenced by _stat ```c const nng_stat *nng_stat_child(const nng_stat *stat); const nng_stat *nng_stat_next(const nng_stat *stat); +const nng_stat *nng_stat_parent(const nng_stat *stat); ``` Traversing the tree of statistics is done using the {{i:`nng_stat_child`}} and @@ -67,6 +68,9 @@ or `NULL` if the _stat_ has no children. The `nng_stat_next` function returns the nearest sibling to the right of _stat_, or `NULL` if _stat_ has no more siblings to the right. +The {{i:`nng_stat_parent`}} function returns the parent of _stat_, or `NULL` if +_stat_ is the root of the statistics tree. + ## Finding a Statistic ```c diff --git a/docs/ref/xref.md b/docs/ref/xref.md index 8f161de8..c6a4fa40 100644 --- a/docs/ref/xref.md +++ b/docs/ref/xref.md @@ -46,12 +46,25 @@ [`nng_cv_wait`]: /api/synch.md#waiting-for-the-condition [`nng_cv_wake`]: /api/synch.md#signaling-the-condition [`nng_cv_wake1`]: /api/synch.md#signaling-the-condition +[`nng_stat`]: /api/stats.md#statistic-structure +[`nng_stats_get`]: /api/stats.md#collecting-a-snapshot +[`nng_stats_free`]: /api/stats.md#freeing-a-snapshot +[`nng_stat_find`]: /api/stats.md#finding-a-statistic +[`nng_stat_find_dialer`]: /api/stats.md#finding-a-statistic +[`nng_stat_find_listener`]: /api/stats.md#finding-a-statistic +[`nng_stat_find_socket`]: /api/stats.md#finding-a-statistic +[`nng_stat_name`]: /api/stats.md#statistic-identification +[`nng_stat_desc`]: /api/stats.md#statistic-identification [`nng_stat_type`]: /api/stats.md#statistic-type [`nng_stats_free`]: /api/stats.md#freeing-a-snapshot [`nng_stat_value`]: /api/stats.md#statistic-value [`nng_stat_bool`]: /api/stats.md#statistic-value [`nng_stat_string`]: /api/stats.md#statistic-value [`nng_stat_unit`]: /api/stats.md#statistic-units +[`nng_stat_next`]: /api/stats.md#traversing-the-three +[`nng_stat_child`]: /api/stats.md#traversing-the-tree +[`nng_stat_parent`]: /api/stats.md#traversing-the-tree +[`nng_stat_timestamp`]: /api/stats.md#statistic-timestamp [`nng_id_set`]: /api/id_map.md#store-a-value [`nng_strerror`]: /api/errors.md#human-readable-error-message [`nng_aio`]: /api/aio.md#asynchronous-io-handle @@ -150,6 +163,11 @@ [`NNG_STAT_SCOPE`]: /api/stats.md#NNG_STAT_SCOPE [`NNG_STAT_STRING`]: /api/stats.md#NNG_STAT_STRING [`NNG_STAT_BOOLEAN`]: /api/stats.md#NNG_STAT_BOOLEAN +[`NNG_UNIT_NONE`]: /api/stats.md#statistic-units +[`NNG_UNIT_BYTES`]: /api/stats.md#statistic-units +[`NNG_UNIT_MESSAGES`]: /api/stats.md#statistic-units +[`NNG_UNIT_MILLIS`]: /api/stats.md#statistic-units +[`NNG_UNIT_EVENTS`]: /api/stats.md#statistic-units -- cgit v1.2.3-70-g09d2