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 // $Id: XrdXrootdStats.hh 29874 2009-08-21 16:56:04Z ganis $ 00014 00015 #include "XrdSys/XrdSysPthread.hh" 00016 00017 class XrdSfsFileSystem; 00018 class XrdStats; 00019 class XrdXrootdResponse; 00020 00021 class XrdXrootdStats 00022 { 00023 public: 00024 int Count; // Stats: Number of matches 00025 int errorCnt; // Stats: Number of errors returned 00026 int redirCnt; // Stats: Number of redirects 00027 int stallCnt; // Stats: Number of stalls 00028 int getfCnt; // Stats: Number of getfiles 00029 int putfCnt; // Stats: Number of putfiles 00030 int openCnt; // Stats: Number of opens 00031 int readCnt; // Stats: Number of reads 00032 int prerCnt; // Stats: Number of reads (pre) 00033 int writeCnt; // Stats: Number of writes 00034 int syncCnt; // Stats: Number of sync 00035 int miscCnt; // Stats: Number of miscellaneous 00036 int AsyncNum; // Stats: Number of async ops 00037 int AsyncMax; // Stats: Number of async max 00038 int AsyncRej; // Stats: Number of async rejected 00039 int AsyncNow; // Stats: Number of async now (not locked) 00040 int Refresh; // Stats: Number of refresh requests 00041 00042 XrdSysMutex statsMutex; // Mutex to serialize updates 00043 00044 void setFS(XrdSfsFileSystem *fsp) {fsP = fsp;} 00045 00046 int Stats(char *buff, int blen, int do_sync=0); 00047 00048 int Stats(XrdXrootdResponse &resp, const char *opts); 00049 00050 XrdXrootdStats(XrdStats *sp); 00051 ~XrdXrootdStats() {} 00052 private: 00053 00054 XrdSfsFileSystem *fsP; 00055 XrdStats *xstats; 00056 }; 00057 #endif