table of contents
- experimental 1.2.1+dfsg-1
NN_GET_STATISTIC(3) | nanomsg 1.2.1 | NN_GET_STATISTIC(3) |
NAME¶
nn_get_statistic - retrieve statistics from nanomsg socket
SYNOPSIS¶
#include <nanomsg/nn.h>
uint64_t nn_get_statistic (int s, int statistic);
DESCRIPTION¶
Retrieves the value of a statistic from the socket.
Caution
While this API is stable, these statistics are intended for
human consumption, to facilitate observability and debugging. The actual
statistics themselves as well as their meanings are unstable, and subject to
change without notice. Programs should not depend on the presence or values
of any particular statistic.
The following statistics are maintained by the nanomsg core framework; others may be present. As those are undocumented, no interpretration should be made from them. Not all statistics are relevant to all transports. For example, the nn_inproc(7) transport does not maintain any of the connection related statistics.
NN_STAT_ESTABLISHED_CONNECTIONS
NN_STAT_ACCEPTED_CONNECTIONS
NN_STAT_DROPPED_CONNECTIONS
NN_STAT_BROKEN_CONNECTIONS
NN_STAT_CONNECT_ERRORS
NN_STAT_BIND_ERRORS
NN_STAT_ACCEPT_ERRORS
NN_STAT_CURRENT_CONNECTIONS
NN_STAT_MESSAGES_SENT
NN_STAT_MESSAGES_RECEIVED
NN_STAT_BYTES_SENT
NN_STAT_BYTES_RECEIVED
RETURN VALUE¶
On success, the value of the statistic is returned, otherwise (uint64_t)-1 is returned.
ERRORS¶
EINVAL
EBADF
ETERM
EXAMPLE¶
val = nn_get_statistic (s, NN_STAT_MESSAGES_SENT); if (val == 0)
printf ("No messages have been sent yet.\n");
SEE ALSO¶
AUTHORS¶
Garrett D’Amore <garrett@damore.org>
2024-02-21 |