xrootd
XrdXrootdStats.hh
Go to the documentation of this file.
00001 #ifndef __XROOTD_STATS_H__
00002 #define __XROOTD_STATS_H__
00003 /******************************************************************************/
00004 /*                                                                            */
00005 /*                     X r d X r o o t d S t a t s . h h                      */
00006 /*                                                                            */
00007 /* (c) 2004 by the Board of Trustees of the Leland Stanford, Jr., University  */
00008 /*       All Rights Reserved. See XrdInfo.cc for complete License Terms       */
00009 /*   Produced by Andrew Hanushevsky for Stanford University under contract    */
00010 /*              DE-AC03-76-SFO0515 with the Department of Energy              */
00011 /******************************************************************************/
00012 
00013 #include "XrdSys/XrdSysPthread.hh"
00014 
00015 class XrdSfsFileSystem;
00016 class XrdStats;
00017 class XrdXrootdResponse;
00018 
00019 class XrdXrootdStats
00020 {
00021 public:
00022 int              Count;        // Stats: Number of matches
00023 int              errorCnt;     // Stats: Number of errors returned
00024 long long        redirCnt;     // Stats: Number of redirects
00025 int              stallCnt;     // Stats: Number of stalls
00026 int              getfCnt;      // Stats: Number of getfiles
00027 int              putfCnt;      // Stats: Number of putfiles
00028 int              openCnt;      // Stats: Number of opens
00029 long long        readCnt;      // Stats: Number of reads
00030 long long        prerCnt;      // Stats: Number of reads (pre)
00031 long long        writeCnt;     // Stats: Number of writes
00032 int              syncCnt;      // Stats: Number of sync
00033 int              miscCnt;      // Stats: Number of miscellaneous
00034 long long        AsyncNum;     // Stats: Number of async ops
00035 long long        AsyncRej;     // Stats: Number of async rejected
00036 long long        AsyncNow;     // Stats: Number of async now (not locked)
00037 int              AsyncMax;     // Stats: Number of async max
00038 int              Refresh;      // Stats: Number of refresh requests
00039 
00040 XrdSysMutex      statsMutex;   // Mutex to serialize updates
00041 
00042 void             setFS(XrdSfsFileSystem *fsp) {fsP = fsp;}
00043 
00044 int              Stats(char *buff, int blen, int do_sync=0);
00045 
00046 int              Stats(XrdXrootdResponse &resp, const char *opts);
00047 
00048                  XrdXrootdStats(XrdStats *sp);
00049                 ~XrdXrootdStats() {}
00050 private:
00051 
00052 XrdSfsFileSystem *fsP;
00053 XrdStats *xstats;
00054 };
00055 #endif