#include "dnxTransport.h"
Go to the source code of this file.
Data Structures | |
struct | DnxNodeData |
The data of a node. More... | |
Typedefs | |
typedef int | DnxStatsNodeCB (DnxNodeData *node, void *data) |
The node stats callback method signature. | |
Enumerations | |
enum | DnxStatsIndex { REQUESTS_RECEIVED = 0, REQUESTS_EXPIRED, DISPATCHES_OK, DISPATCHES_FAILED, RESULTS_OK, RESULTS_FAILED, RESULTS_TIMED_OUT, JOBS_HANDLED, JOBS_REJECTED_NO_SLOTS, JOBS_REJECTED_NO_NODES, POST_RESULTS_OK, POST_RESULTS_FAILED, STATS_COUNT, REQUESTS_RECEIVED = 0, REQUESTS_EXPIRED, DISPATCHES_OK, DISPATCHES_FAILED, RESULTS_OK, RESULTS_FAILED, RESULTS_TIMED_OUT, JOBS_HANDLED, JOBS_REJECTED_NO_SLOTS, JOBS_REJECTED_NO_NODES, POST_RESULTS_OK, POST_RESULTS_FAILED, STATS_COUNT } |
An enumeration of stats in the server stats structure. More... | |
Functions | |
void | dnxStatsGetServerStats (unsigned *statsbuf) |
Return a current snapshot of the server stats array. | |
void | dnxStatsResetServerStats (void) |
Reset all server stats to zero. | |
void | dnxStatsInc (char *addr, DnxStatsIndex member) |
Increment a member value from a single node. | |
int | dnxStatsForEachNode (DnxStatsNodeCB *cb, void *data) |
For each node in the list, call a method and pass some data. | |
int | dnxStatsForNodeByAddrStr (char *addrstr, DnxStatsNodeCB *cb, void *data) |
For the specified node, call a method and pass some data. | |
void | dnxStatsCleanup () |
A destructor for the stats management module. |
DNX node management includes the ability to efficiently track nodes by binary address, and to increment a set of statistics for each node. Access is read- only except for incrementing and clearing stats. Nodes may be added but not removed. This is done so that locking may be minimized to reduce lock contention.
Definition in file dnxStats.h.
typedef int DnxStatsNodeCB(DnxNodeData *node, void *data) |
The node stats callback method signature.
[in] | node | - the node data reference for this iteration. |
[in] | data | - an opaque pointer pasSed from the interface method. |
Definition at line 79 of file dnxStats.h.
enum DnxStatsIndex |
An enumeration of stats in the server stats structure.
Definition at line 41 of file dnxStats.h.
void dnxStatsCleanup | ( | ) |
A destructor for the stats management module.
This function can be used to cleanup any resources allocated by this module before shutdown.
Definition at line 256 of file dnxStats.c.
int dnxStatsForEachNode | ( | DnxStatsNodeCB * | cb, | |
void * | data | |||
) |
For each node in the list, call a method and pass some data.
[in] | cb | - the node processing function to be called. |
[in] | data | - opaque data pointer passed to nodeProc. |
nodeProc
. Definition at line 219 of file dnxStats.c.
int dnxStatsForNodeByAddrStr | ( | char * | addrstr, | |
DnxStatsNodeCB * | cb, | |||
void * | data | |||
) |
For the specified node, call a method and pass some data.
[in] | addrstr | - the DNS or dotted decimal address of the node. |
[in] | cb | - the node processing function to be called. |
[in] | data | - opaque data pointer passed to nodeProc. |
nodeProc
. Definition at line 234 of file dnxStats.c.
void dnxStatsGetServerStats | ( | unsigned * | statsbuf | ) |
Return a current snapshot of the server stats array.
The statsbuf
array should be at least STATS_COUNT elements in length.
[out] | statsbuf | - the address of storage for all server stats. |
Definition at line 192 of file dnxStats.c.
void dnxStatsInc | ( | char * | addr, | |
DnxStatsIndex | member | |||
) |
Increment a member value from a single node.
[in] | addr | - the address of the node for which a stat should be incremented. This is the binary address, not the presentation address. |
[in] | member | - the stat to be incremented. |
Definition at line 206 of file dnxStats.c.
void dnxStatsResetServerStats | ( | void | ) |