00001 #ifndef __XRDOFS_STATS_H__
00002 #define __XRDOFS_STATS_H__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include <stdlib.h>
00016
00017 #include "XrdSys/XrdSysPthread.hh"
00018
00019 class XrdOfsStats
00020 {
00021 public:
00022
00023 struct StatsData
00024 {
00025 int numOpenR;
00026 int numOpenW;
00027 int numOpenP;
00028 int numUnpsist;
00029 int numHandles;
00030 int numRedirect;
00031 int numStarted;
00032 int numReplies;
00033 int numErrors;
00034 int numDelays;
00035 int numSeventOK;
00036 int numSeventER;
00037 } Data;
00038
00039 XrdSysMutex sdMutex;
00040
00041 inline void Add(int &Cntr) {sdMutex.Lock(); Cntr++; sdMutex.UnLock();}
00042
00043 inline void Dec(int &Cntr) {sdMutex.Lock(); Cntr--; sdMutex.UnLock();}
00044
00045 int Report(char *Buff, int Blen);
00046
00047 void setRole(const char *theRole) {myRole = theRole;}
00048
00049 XrdOfsStats() {memset(&Data, 0, sizeof(Data));}
00050 ~XrdOfsStats() {}
00051
00052 private:
00053
00054 const char *myRole;
00055 };
00056 #endif