uint64_t *nn_get_statistic (int s, int statistic);
Retrieves the value of a statistic from the socket.
|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.
The number of connections successfully established that were initiated from this socket.
The number of connections successfully established that were accepted by this socket.
The number of established connections that were dropped by this socket.
The number of established connections that were closed by this socket, typically due to protocol errors.
The number of errors encountered by this socket trying to connect to a remote peer.
The number of errors encountered by this socket trying to bind to a local address.
The number of errors encountered by this socket trying to accept a a connection from a remote peer.
The number of connections currently estabalished to this socket.
The number messages sent by this socket.
The number messages received by this socket.
The number of bytes sent by this socket.
The number of bytes received by this socket.
On success, the value of the statistic is returned, otherwise (uint64_t)-1 is returned.
The statistic is invalid or unsupported.
The provided socket is invalid.
The library is terminating.
val = nn_get_statistic (s, NN_STAT_SENT_MESSAGES); if (val == 0) printf ("No messages have been sent yet.\n");