dnxStats.h

Go to the documentation of this file.
00001 /*--------------------------------------------------------------------------
00002 
00003    Copyright (c) 2006-2010, Intellectual Reserve, Inc. All rights reserved.
00004 
00005    This program is free software; you can redistribute it and/or modify
00006    it under the terms of the GNU General Public License version 2 as
00007    published by the Free Software Foundation.
00008 
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012    GNU General Public License for more details.
00013 
00014    You should have received a copy of the GNU General Public License
00015    along with this program; if not, write to the Free Software
00016    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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    // new node/server stats should be added here
00051 
00052    JOBS_HANDLED,                    
00053    JOBS_REJECTED_NO_SLOTS,          
00054    JOBS_REJECTED_NO_NODES,          
00055    POST_RESULTS_OK,                 
00056    POST_RESULTS_FAILED,             
00057    // new server-only stats should be added here
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   /* _DNXSTATS_H_ */
00130 

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