dnxStats.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00035 #ifndef _DNXSTATS_H_
00036 #define _DNXSTATS_H_
00037
00038 #include "dnxTransport.h"
00039
00041 typedef enum DnxStatsIndex
00042 {
00043 REQUESTS_RECEIVED = 0,
00044 REQUESTS_EXPIRED,
00045 DISPATCHES_OK,
00046 DISPATCHES_FAILED,
00047 RESULTS_OK,
00048 RESULTS_FAILED,
00049 RESULTS_TIMED_OUT,
00050
00051
00052 JOBS_HANDLED,
00053 JOBS_REJECTED_NO_SLOTS,
00054 JOBS_REJECTED_NO_NODES,
00055 POST_RESULTS_OK,
00056 POST_RESULTS_FAILED,
00057
00058
00059 STATS_COUNT
00060 } DnxStatsIndex;
00061
00063 typedef struct DnxNodeData
00064 {
00065 char address[DNX_MAX_ADDRESS];
00066 char addrstr[DNX_MAX_ADDRSTR];
00067 unsigned stats[JOBS_HANDLED];
00068 } DnxNodeData;
00069
00079 typedef int DnxStatsNodeCB(DnxNodeData * node, void * data);
00080
00087 void dnxStatsGetServerStats(unsigned * statsbuf);
00088
00091 void dnxStatsResetServerStats(void);
00092
00099 void dnxStatsInc(char * addr, DnxStatsIndex member);
00100
00109 int dnxStatsForEachNode(DnxStatsNodeCB * cb, void * data);
00110
00120 int dnxStatsForNodeByAddrStr(char * addrstr, DnxStatsNodeCB * cb, void * data);
00121
00127 void dnxStatsCleanup();
00128
00129 #endif
00130