dnxStats.h File Reference

#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.


Typedef Documentation

typedef int DnxStatsNodeCB(DnxNodeData *node, void *data)

The node stats callback method signature.

Parameters:
[in] node - the node data reference for this iteration.
[in] data - an opaque pointer pasSed from the interface method.
Returns:
0 on success, non-zero to cancel callbacks. This value is returned to the interface method, unless it's DNX_CBCANCEL which is converted to success.

Definition at line 79 of file dnxStats.h.


Enumeration Type Documentation

An enumeration of stats in the server stats structure.

Enumerator:
REQUESTS_RECEIVED  Requests received (node/srv).
REQUESTS_EXPIRED  Expired requests (node/srv).
DISPATCHES_OK  Successful dispatches (node/srv).
DISPATCHES_FAILED  Failed dispatches (node/srv).
RESULTS_OK  Successful results received (node/srv).
RESULTS_FAILED  Failed results received (node/srv).
RESULTS_TIMED_OUT  Timed out results received (node/srv).
JOBS_HANDLED  Jobs handled by DNX (srv only).
JOBS_REJECTED_NO_SLOTS  Jobs rejected because of no slots (srv only).
JOBS_REJECTED_NO_NODES  Jobs rejected beause of no node requests (srv only).
POST_RESULTS_OK  Successful results posted to Nagios (srv only).
POST_RESULTS_FAILED  Failed results posted to Nagios (srv only).
STATS_COUNT  Node stats available.
REQUESTS_RECEIVED  Requests received (node/srv).
REQUESTS_EXPIRED  Expired requests (node/srv).
DISPATCHES_OK  Successful dispatches (node/srv).
DISPATCHES_FAILED  Failed dispatches (node/srv).
RESULTS_OK  Successful results received (node/srv).
RESULTS_FAILED  Failed results received (node/srv).
RESULTS_TIMED_OUT  Timed out results received (node/srv).
JOBS_HANDLED  Jobs handled by DNX (srv only).
JOBS_REJECTED_NO_SLOTS  Jobs rejected because of no slots (srv only).
JOBS_REJECTED_NO_NODES  Jobs rejected beause of no node requests (srv only).
POST_RESULTS_OK  Successful results posted to Nagios (srv only).
POST_RESULTS_FAILED  Failed results posted to Nagios (srv only).
STATS_COUNT  Node stats available.

Definition at line 41 of file dnxStats.h.


Function Documentation

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.

References elemcount, and DnxNode::next.

Referenced by dnxServerDeInit().

int dnxStatsForEachNode ( DnxStatsNodeCB cb,
void *  data 
)

For each node in the list, call a method and pass some data.

Parameters:
[in] cb - the node processing function to be called.
[in] data - opaque data pointer passed to nodeProc.
Returns:
zero on success or callback-cancelled, or a non-zero error code returned by nodeProc.

Definition at line 219 of file dnxStats.c.

References DnxNode::data, DNX_CBCANCEL, elemcount, and DnxNode::next.

Referenced by buildMgmtNodeListReply(), buildMgmtStatsReply(), and dnxAgentServer().

int dnxStatsForNodeByAddrStr ( char *  addrstr,
DnxStatsNodeCB cb,
void *  data 
)

For the specified node, call a method and pass some data.

Parameters:
[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.
Returns:
zero on success or callback-cancelled, or a non-zero error code returned by nodeProc.

Definition at line 234 of file dnxStats.c.

References DnxNode::data, and dnxGetNode().

Referenced by buildMgmtNodeStatsReply().

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.

Parameters:
[out] statsbuf - the address of storage for all server stats.

Definition at line 192 of file dnxStats.c.

References s_serverStats.

Referenced by buildMgmtStatsReply().

void dnxStatsInc ( char *  addr,
DnxStatsIndex  member 
)

Increment a member value from a single node.

Parameters:
[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.

References DnxNode::data, dnxGetNode(), s_serverStats, DnxNodeData::stats, and STATS_COUNT.

Referenced by dnxDispatcher(), dnxGetNodeRequest(), dnxPostNewJob(), dnxPostResult(), dnxRegisterNode(), and dnxTimer().

void dnxStatsResetServerStats ( void   ) 

Reset all server stats to zero.

Definition at line 199 of file dnxStats.c.

References s_serverStats.

Referenced by dnxAgentServer().


Generated on Tue Apr 13 15:48:08 2010 for DNX by  doxygen 1.5.6