00001 #ifndef __XRDXROOTDMONFILE__ 00002 #define __XRDXROOTDMONFILE__ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d X r o o t d M o n F i l e . h h */ 00006 /* */ 00007 /* (c) 2012 by the Board of Trustees of the Leland Stanford, Jr., University */ 00008 /* All Rights Reserved */ 00009 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00010 /* DE-AC02-76-SFO0515 with the Department of Energy */ 00011 /* */ 00012 /* This file is part of the XRootD software suite. */ 00013 /* */ 00014 /* XRootD is free software: you can redistribute it and/or modify it under */ 00015 /* the terms of the GNU Lesser General Public License as published by the */ 00016 /* Free Software Foundation, either version 3 of the License, or (at your */ 00017 /* option) any later version. */ 00018 /* */ 00019 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */ 00020 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */ 00021 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */ 00022 /* License for more details. */ 00023 /* */ 00024 /* You should have received a copy of the GNU Lesser General Public License */ 00025 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */ 00026 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */ 00027 /* */ 00028 /* The copyright holder's institutional names and contributor's names may not */ 00029 /* be used to endorse or promote products derived from this software without */ 00030 /* specific prior written permission of the institution or contributor. */ 00031 /******************************************************************************/ 00032 00033 #include "Xrd/XrdJob.hh" 00034 #include "XrdSys/XrdSysPthread.hh" 00035 #include "XrdXrootd/XrdXrootdMonFMap.hh" 00036 #include "XrdXrootd/XrdXrootdMonitor.hh" 00037 00038 class XrdXrootdFileStats; 00039 class XrdXrootdMonHeader; 00040 class XrdXrootdMonTrace; 00041 00042 class XrdXrootdMonFile : XrdJob 00043 { 00044 public: 00045 00046 static void Close(XrdXrootdFileStats *fsP, bool isDisc=false); 00047 00048 static void Defaults(int intv, int opts, int iocnt); 00049 00050 static void Disc(unsigned int usrID); 00051 00052 void DoIt(); 00053 00054 static bool Init(int bfsz=65472); 00055 00056 static void Open(XrdXrootdFileStats *fsP, 00057 const char *Path, unsigned int uDID, bool isRW); 00058 00059 XrdXrootdMonFile() : XrdJob("monitor fstat") {} 00060 ~XrdXrootdMonFile() {} 00061 00062 private: 00063 00064 static void DoXFR(); 00065 static void DoXFR(XrdXrootdFileStats *fsP); 00066 static void Flush(); 00067 static char *GetSlot(int slotSZ); 00068 00069 static XrdSysMutex bfMutex; 00070 static XrdSysMutex fmMutex; 00071 static XrdXrootdMonFMap fmMap[XrdXrootdMonFMap::mapNum]; 00072 static short fmUse[XrdXrootdMonFMap::mapNum]; 00073 static char *repBuff; 00074 static XrdXrootdMonHeader *repHdr; 00075 static XrdXrootdMonFileTOD *repTOD; 00076 static char *repNext; 00077 static char *repFirst; 00078 static char *repLast; 00079 static int totRecs; 00080 static int xfrRecs; 00081 static int repSize; 00082 static int repTime; 00083 static int fmHWM; 00084 static int crecSize; 00085 static int xfrCnt; 00086 static int xfrRem; 00087 static XrdXrootdMonFileXFR xfrRec; 00088 static short crecNLen; 00089 static short trecNLen; 00090 static char fsLFN; 00091 static char fsLVL; 00092 static char fsOPS; 00093 static char fsSSQ; 00094 static char fsXFR; 00095 static char crecFlag; 00096 }; 00097 #endif