diff options
| author | Garrett D'Amore <garrett@damore.org> | 2020-11-11 21:29:54 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2020-11-11 23:51:13 -0800 |
| commit | 66ff33813a8cd9d4cba96280bb613762fb0c2ce2 (patch) | |
| tree | 4d9230b87715ebb1ff876894cd805ee4da42eccb /docs/man | |
| parent | 53f20bbc4a2bd0d333e0307640883a778de31e2b (diff) | |
| download | nng-66ff33813a8cd9d4cba96280bb613762fb0c2ce2.tar.gz nng-66ff33813a8cd9d4cba96280bb613762fb0c2ce2.tar.bz2 nng-66ff33813a8cd9d4cba96280bb613762fb0c2ce2.zip | |
fixes #1323 stats framework is *way* to heavy
This should reduce the amount of copying, and the overall size
used by pipes and other objects quite a bit. (On my system, the
sizeof nni_pipe shrank by 400 bytes, for example.)
Diffstat (limited to 'docs/man')
| -rw-r--r-- | docs/man/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | docs/man/libnng.3.adoc | 3 | ||||
| -rw-r--r-- | docs/man/nng_stat_bool.3.adoc | 50 | ||||
| -rw-r--r-- | docs/man/nng_stat_string.3.adoc | 5 | ||||
| -rw-r--r-- | docs/man/nng_stat_value.3.adoc | 9 |
5 files changed, 62 insertions, 7 deletions
diff --git a/docs/man/CMakeLists.txt b/docs/man/CMakeLists.txt index 0f175195..a33d4ee8 100644 --- a/docs/man/CMakeLists.txt +++ b/docs/man/CMakeLists.txt @@ -163,6 +163,7 @@ if (NNG_ENABLE_DOC) nng_socket_set nng_stats_free nng_stats_get + nng_stat_bool nng_stat_child nng_stat_desc nng_stat_find @@ -354,6 +355,7 @@ if (NNG_ENABLE_DOC) nng_options nng_pipe nng_sockaddr + nng_sockaddr_abstract nng_sockaddr_in nng_sockaddr_in6 nng_sockaddr_inproc diff --git a/docs/man/libnng.3.adoc b/docs/man/libnng.3.adoc index ab1a6b11..ccc2732c 100644 --- a/docs/man/libnng.3.adoc +++ b/docs/man/libnng.3.adoc @@ -239,6 +239,7 @@ The following functions provide access to statistics which can be used to observe program behaviors and as an aid in troubleshooting. |=== +|xref:nng_stat_bool.3.adoc[nng_stat_bool()]|get statistic Boolean value |xref:nng_stat_child.3.adoc[nng_stat_child()]|get child statistic |xref:nng_stat_desc.3.adoc[nng_stat_name()]|get statistic description |xref:nng_stat_find.3.adoc[nng_stat_find()]|find statistic by name @@ -251,7 +252,7 @@ to observe program behaviors and as an aid in troubleshooting. |xref:nng_stat_timestamp.3.adoc[nng_stat_timestamp()]|get statistic timestamp |xref:nng_stat_type.3.adoc[nng_stat_type()]|get statistic type |xref:nng_stat_unit.3.adoc[nng_stat_unit()]|get statistic unit -|xref:nng_stat_value.3.adoc[nng_stat_value()]|get statistic value +|xref:nng_stat_value.3.adoc[nng_stat_value()]|get statistic numeric value |xref:nng_stats_free.3.adoc[nng_stats_free()]|free statistics |xref:nng_stats_get.3.adoc[nng_stats_get()]|get statistics |=== diff --git a/docs/man/nng_stat_bool.3.adoc b/docs/man/nng_stat_bool.3.adoc new file mode 100644 index 00000000..17b7bbca --- /dev/null +++ b/docs/man/nng_stat_bool.3.adoc @@ -0,0 +1,50 @@ += nng_stat_value(3) +// +// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2018 Capitar IT Group BV <info@capitar.com> +// +// This document is supplied under the terms of the MIT License, a +// copy of which should be located in the distribution where this +// file was obtained (LICENSE.txt). A copy of the license may also be +// found online at https://opensource.org/licenses/MIT. +// + +== NAME + +nng_stat_value - get statistic value + +== SYNOPSIS + +[source, c] +---- +#include <nng/nng.h> + +typedef struct nng_stat nng_stat; + +bool nng_stat_bool(nng_stat *stat); +---- + +== DESCRIPTION + +The `nng_stat_bool()` function returns the Boolean value for the statistic _stat_. +Otherwise, if the statistic is not of Boolean type, the result is indeterminate. +See xref:nng_stat_type.3.adoc[`nng_stat_type()`] for a description of statistic types. + +== RETURN VALUES + +The boolean value associated with _stat_. + +== ERRORS + +None. + +== SEE ALSO + +[.text-left] +xref:libnng.3.adoc[libnng(3)], +xref:nng_stats_get.3.adoc[nng_stats_get(3)], +xref:nng_stat_type.3.adoc[nng_stat_type(3)], +xref:nng_stat_unit.3.adoc[nng_stat_unit(3)], +xref:nng_stat_value.3.adoc[nng_stat_value(3)], +xref:nng_stat.5.adoc[nng_stat(5)], +xref:nng.7.adoc[nng(7)] diff --git a/docs/man/nng_stat_string.3.adoc b/docs/man/nng_stat_string.3.adoc index 3323fef3..4c65fb1a 100644 --- a/docs/man/nng_stat_string.3.adoc +++ b/docs/man/nng_stat_string.3.adoc @@ -1,6 +1,6 @@ = nng_stat_string(3) // -// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2020 Staysail Systems, Inc. <info@staysail.tech> // Copyright 2018 Capitar IT Group BV <info@capitar.com> // // This document is supplied under the terms of the MIT License, a @@ -31,6 +31,9 @@ which must be of type `NNG_STAT_STRING` (see xref:nng_stat_type.3.adoc[`nng_stat If the statistic is not of type `NNG_STAT_STRING`, then `NULL` will be returned. +NOTE: The returned string is valid until xref:nng_stats_free.3.adoc[`nng_stats_free()`] is called to +free the memory for the snapshot. + == RETURN VALUES The string value associated with _stat_, or `NULL` if the statistic is not diff --git a/docs/man/nng_stat_value.3.adoc b/docs/man/nng_stat_value.3.adoc index 6f1b9201..32b87e12 100644 --- a/docs/man/nng_stat_value.3.adoc +++ b/docs/man/nng_stat_value.3.adoc @@ -1,6 +1,6 @@ = nng_stat_value(3) // -// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2020 Staysail Systems, Inc. <info@staysail.tech> // Copyright 2018 Capitar IT Group BV <info@capitar.com> // // This document is supplied under the terms of the MIT License, a @@ -27,14 +27,12 @@ uint64_t nng_stat_value(nng_stat *stat); == DESCRIPTION The `nng_stat_value()` function returns a numeric value for the statistic _stat_. -If the statistic has a boolean value, then zero is returned for `false`, and -one is returned for `true`. -Otherwise, if the statistic is not of numeric type, then zero is returned. +If the statistic is not of numeric type, then zero is returned. See xref:nng_stat_type.3.adoc[`nng_stat_type()`] for a description of statistic types. == RETURN VALUES -The numeric or boolean value associated with _stat_. +The numeric value associated with _stat_. == ERRORS @@ -45,6 +43,7 @@ None. [.text-left] xref:libnng.3.adoc[libnng(3)], xref:nng_stats_get.3.adoc[nng_stats_get(3)], +xref:nng_stat_bool.3.adoc[nng_stat_bool(3)], xref:nng_stat_type.3.adoc[nng_stat_type(3)], xref:nng_stat_unit.3.adoc[nng_stat_unit(3)], xref:nng_stat.5.adoc[nng_stat(5)], |
